зеркало из https://github.com/stride3d/freetype.git
[apinames] Fix the overflow of signed integer hash.
* src/tools/apinames.c (names_add): Change the type of `h' from int to unsigned int, to prevent undefined behaviour in the overflow of signed integers (overflow of unsigned int is defined to be wrap around). Found by clang test suggested by Sean McBride.
This commit is contained in:
Родитель
628bebe639
Коммит
eba2781ab9
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2011-11-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
||||
|
||||
[apinames] Fix the overflow of signed integer hash.
|
||||
|
||||
* src/tools/apinames.c (names_add): Change the type of `h' from
|
||||
int to unsigned int, to prevent undefined behaviour in the
|
||||
overflow of signed integers (overflow of unsigned int is defined
|
||||
to be wrap around). Found by clang test suggested by Sean
|
||||
McBride.
|
||||
|
||||
2011-11-30 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[winfonts] Remove casts.
|
||||
|
|
|
@ -59,8 +59,9 @@ static void
|
|||
names_add( const char* name,
|
||||
const char* end )
|
||||
{
|
||||
int nn, len, h;
|
||||
Name nm;
|
||||
unsigned int h;
|
||||
int nn, len;
|
||||
Name nm;
|
||||
|
||||
if ( end <= name )
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче