diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2004-11-25 21:19:11 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2004-11-25 21:19:11 +0000 |
commit | 50986a34f231fbc7a4b62466bd89bd4ae4027d2e (patch) | |
tree | 99344977192a8fc0820713b562c704016da6554e /src/hashtab.c | |
parent | a983dafac59dcb425666a5a5556da4734e50c6c5 (diff) |
Fixes for CAN-2004-0914 (Thomas Biege).xprint_packagertest_20041125_basexprint_packagertest_20041125
Diffstat (limited to 'src/hashtab.c')
-rw-r--r-- | src/hashtab.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hashtab.c b/src/hashtab.c index f07cb6d..f5a71dd 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -138,13 +138,13 @@ HashTableGrows(table) unsigned int size = table->size; xpmHashAtom *t, *p; int i; - int oldSize = size; + unsigned int oldSize = size; t = atomTable; HASH_TABLE_GROWS table->size = size; table->limit = size / 3; - if (size >= SIZE_MAX / sizeof(*atomTable)) + if (size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(size * sizeof(*atomTable)); if (!atomTable) @@ -206,7 +206,7 @@ xpmHashTableInit(table) table->size = INITIAL_HASH_SIZE; table->limit = table->size / 3; table->used = 0; - if (table->size >= SIZE_MAX / sizeof(*atomTable)) + if (table->size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(table->size * sizeof(*atomTable)); if (!atomTable) |