Better code searching for Debian
Better code searching for Debian
Posted Dec 26, 2014 4:15 UTC (Fri) by mathstuf (subscriber, #69389)In reply to: Better code searching for Debian by amarao
Parent article: Better code searching for Debian
Posted Dec 29, 2014 23:56 UTC (Mon)
by debacle (subscriber, #7114)
[Link] (5 responses)
Posted Dec 31, 2014 0:13 UTC (Wed)
by lsl (subscriber, #86508)
[Link] (4 responses)
Posted Dec 31, 2014 11:52 UTC (Wed)
by JGR (subscriber, #93631)
[Link] (2 responses)
I agree that ldpreloading something like the above isn't helpful, but "never use strcpy (directly, use strlcpy or some other wrapper function which takes an output buffer length, does a strlen and does suitable error checking/calls abort first)" is perfectly sound advice.
Posted Jan 8, 2015 21:59 UTC (Thu)
by dfsmith (guest, #20302)
[Link] (1 responses)
Posted Jan 8, 2015 22:43 UTC (Thu)
by zlynx (guest, #2285)
[Link]
I know its a feature because I switched some code from strncpy to strlcpy because profiling showed writing the zeros into an 8KB URL string buffer was wasting a LOT of time.
If you are worried about information leaks then you need to be using a security library and it needs to be written in ASM because compilers are too likely to optimize all the security features away. For example, unless a value is volatile the compiler can remove all writes to it if nothing reads it before destroying it.
Posted Dec 31, 2014 14:10 UTC (Wed)
by debacle (subscriber, #7114)
[Link]
Let us all LD_PRELOAD this function to everything:
Better code searching for Debian
char *strcpy(char *dest, const char *src)
{
system("logger BUG!");
return NULL;
}
Better code searching for Debian
Better code searching for Debian
Better code searching for Debian
Better code searching for Debian
Better code searching for Debian