Fossil SCM
Fix a potential integer overflow in the bag_hash() function.
Commit
34276d22e558fbde2705ca0457caefb647b7f387602aca4e0a7621ae65d05f13
Parent
3d1e634d16e53cb…
1 file changed
+1
-1
+1
-1
| --- src/bag.c | ||
| +++ src/bag.c | ||
| @@ -74,11 +74,11 @@ | ||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /* |
| 77 | 77 | ** The hash function |
| 78 | 78 | */ |
| 79 | -#define bag_hash(i) (i*101) | |
| 79 | +#define bag_hash(i) (((u64)(i))*101) | |
| 80 | 80 | |
| 81 | 81 | /* |
| 82 | 82 | ** Change the size of the hash table on a bag so that |
| 83 | 83 | ** it contains N slots |
| 84 | 84 | ** |
| 85 | 85 |
| --- src/bag.c | |
| +++ src/bag.c | |
| @@ -74,11 +74,11 @@ | |
| 74 | } |
| 75 | |
| 76 | /* |
| 77 | ** The hash function |
| 78 | */ |
| 79 | #define bag_hash(i) (i*101) |
| 80 | |
| 81 | /* |
| 82 | ** Change the size of the hash table on a bag so that |
| 83 | ** it contains N slots |
| 84 | ** |
| 85 |
| --- src/bag.c | |
| +++ src/bag.c | |
| @@ -74,11 +74,11 @@ | |
| 74 | } |
| 75 | |
| 76 | /* |
| 77 | ** The hash function |
| 78 | */ |
| 79 | #define bag_hash(i) (((u64)(i))*101) |
| 80 | |
| 81 | /* |
| 82 | ** Change the size of the hash table on a bag so that |
| 83 | ** it contains N slots |
| 84 | ** |
| 85 |