lostcode
02-09-2009, 03:43 AM
Hello,
We have found what we believe is a bug that might be a boundary value check missing in the directory software to prevent using negative values in an unsigned datatype when decrementing post count.
We can reproduce this bug easily:
Have a user with a zero post count post a link in the directory.
Then, have the (approved) link deleted by a moderator.
The post count of the user will then be 4,294,967,295 which is.....
2^32-1 = 4,294,967,295
Hence, the number of posts must be stored as an unsigned 32 bit integer. If post number was a signed 32 bit integer, it would display as -1.
Not sure why the post count goes from 0 to -1 instead of 1 to 0, might be something to do with how the vB cleanup tasks (updated post counts, etc) are sequenced. We have not dived that deep into the bug. We can easily reproduce it, as mentioned.
See attached screenshot.
We have found what we believe is a bug that might be a boundary value check missing in the directory software to prevent using negative values in an unsigned datatype when decrementing post count.
We can reproduce this bug easily:
Have a user with a zero post count post a link in the directory.
Then, have the (approved) link deleted by a moderator.
The post count of the user will then be 4,294,967,295 which is.....
2^32-1 = 4,294,967,295
Hence, the number of posts must be stored as an unsigned 32 bit integer. If post number was a signed 32 bit integer, it would display as -1.
Not sure why the post count goes from 0 to -1 instead of 1 to 0, might be something to do with how the vB cleanup tasks (updated post counts, etc) are sequenced. We have not dived that deep into the bug. We can easily reproduce it, as mentioned.
See attached screenshot.