When a fiobj is of type FIOBJ_T_NUMBER, and it contains a number that overflows long (i64) such as 13725369883134782382, fiobj_obj2num returns the maximum of i64 which is 9223372036854775807.
This occurs to me while using zap, where I am using a unsigned long u64 number in a cookie. I was scratching my head thinking why do session cookie validation only works 50% of the time, turns out it is a classic integer overflow bug. When I switched to i64 for the cookie the bug immediately disappeared.
When a
fiobjis of typeFIOBJ_T_NUMBER, and it contains a number that overflowslong(i64) such as13725369883134782382,fiobj_obj2numreturns the maximum of i64 which is9223372036854775807.This occurs to me while using zap, where I am using a
unsigned longu64 number in a cookie. I was scratching my head thinking why do session cookie validation only works 50% of the time, turns out it is a classic integer overflow bug. When I switched to i64 for the cookie the bug immediately disappeared.