News for hackers. Stuff that matters.
[deleted]
Re:Kernel module for advanced rickrolling replaces open() call by merijnv on Thursday September 08, 2011 @04:52AM (#2973148)
Eh, the code does look for the string terminator. It calls strlen, which indexes the char* until it finds a NULL byte. If the string doesn't have a NULL byte then strlen will happily continue reading past the boundary until it either segfaults or finds a NULL byte.
Re:Kernel module for advanced rickrolling replaces open() call by forgotusername on Thursday September 08, 2011 @07:49AM (#2973485)
Just some random nitpickery, but "NULL" has a specific meaning in C, which is 0 cast to a void pointer. So preferably talk about a "NUL" (as it appears in most ASCII tables) or perhaps "null character" (which is what recent C standards prefer instead, cant remember why they changed though).
Re:Kernel module for advanced rickrolling replaces open() call by datenwolf on Thursday September 08, 2011 @12:24PM (#2974529)
And… you got your nitpickery wrong. A C null pointer is just 0. The exact definition in the statement is "a null pointer is a integral constant expression with value 0".

There are some stddef.h which cast it to a void*, but technically that's just a compatibility hack. See http://c-faq.com/null/macro.html http://c-faq.com/null/safermacs.html http://c-faq.com/null/nullor0.html http://c-faq.com/null/long0.html