• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


コミットメタ情報

リビジョンf77cb9933d71a75b4764173eafc9dd972e190853 (tree)
日時2019-01-12 05:03:49
作者Keith Marshall <keith@user...>
コミッターKeith Marshall

ログメッセージ

Fix a mkstemp() file name generator defect.

変更サマリ

差分

--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,13 @@
11 2019-01-11 Keith Marshall <keith@users.osdn.me>
22
3+ Fix a mkstemp() file name generator defect.
4+
5+ * mingwex/cryptnam.c (crypto_random_filename_char): Revert 2018-09-06
6+ change; argument type must be unsigned char *, to avoid math errors.
7+ (__mingw_crypto_tmpname): Use explicit casts to resolve type conflicts.
8+
9+2019-01-11 Keith Marshall <keith@users.osdn.me>
10+
311 Fix a <stdio.h> typedef omission.
412
513 * include/stdio.h: Adjust comment formatting.
--- a/mingwrt/mingwex/cryptnam.c
+++ b/mingwrt/mingwex/cryptnam.c
@@ -10,7 +10,7 @@
1010 * $Id$
1111 *
1212 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
13- * Copyright (C) 2013, 2014, 2018, MinGW.org Project.
13+ * Copyright (C) 2013, 2014, 2018, 2019, MinGW.org Project.
1414 *
1515 *
1616 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -94,7 +94,8 @@ CRYPTO_INLINE void *crypto_randomize( void *buf, size_t buflen )
9494 return NULL;
9595 }
9696
97-CRYPTO_INLINE char *crypto_random_filename_char( char *caret )
97+CRYPTO_INLINE
98+unsigned char *crypto_random_filename_char( unsigned char *caret )
9899 {
99100 /* Helper to generate a random sequence of characters, suitable for
100101 * use in file names; although there are other valid possibilities, we
@@ -155,12 +156,12 @@ char *__mingw_crypto_tmpname( char *template )
155156 * We begin by locating the position, within the given template,
156157 * where the string of six replaceable 'XXXXXX's should begin.
157158 */
158- char *tail = template + strlen( template ) - 6;
159+ unsigned char *tail = (unsigned char *)(template) + strlen( template ) - 6;
159160
160161 /* Provided this appears sane -- i.e. it at least doesn't place the
161162 * six character "tail" before the start of the template itself...
162163 */
163- if( tail >= template )
164+ if( (char *)(tail) >= template )
164165 {
165166 /* ...then, walk over each of the six bytes of the "tail", until
166167 * we reach the NUL terminator...