The C compiler is too forgiving! sizeof(variable_name+1) allowed?
I carelessly passed: sizeof(s.st_size+1) to an allocator call, instead of: s.st_size+1 and corrupted memory nicely. What the hell would sizeof(variable+1) even mean, and why on earth would the compiler think that is anything close to valid? Both gcc and clang, both with -Wall, are completely quiet about this error!
View On WordPress










