News for hackers. Stuff that matters.
Re:Almost Always Unsigned by dc-programmer on Sunday January 02, 2022 @04:07PM (#29773893)
I’ve seen projects that use a mix of unsigned int, size_t, and off_t variable declarations with implicit conversions between them. This seems like a security hazard if you are handling user input because just checking the original input may be insufficient. size_t in general seems extra ridiculous because max(size_t) is a common sentinel value returned by methods and if you aren’t careful and add to max(size_t) it wraps around to -1.

There are no comments on this comment yet.