From the article: > It has been proven numerous times already that strcpy in source code is like a honey pot for generating hallucinated vulnerability claims This closing thought in the article really stood out to me. Why even bother to run AI checking on C code if the AI flags strcpy() as a problem without caveat?
No strcpy either
31–40 of 151 posts
Re: No strcpy either
#32I've always wondered at the motivatons of the various string routines in C - every one of them seems to have some huge caveat which makes them useless. After years I now think it's essential to have a library which records at least how much memory is allocated to a string along with the pointer. Something like this: https://github.com/msteinert/bstring
But also all of this book-keeping takes up extra time and space which is a trade-off easily made nowadays.
Re: No strcpy either
#33Earlier quoted context omitted.
Yeah but fixed width strings don’t need null termination. You know exactly how long the string is. No need to find that null byte.
Good luck though remembering not to pass one to any function that does expect to find a null terminator.
Re: No strcpy either
#34Re: No strcpy either
#35Re: No strcpy either
#36Earlier quoted context omitted.
Yeah but fixed width strings don’t need null termination. You know exactly how long the string is. No need to find that null byte.
Until you pass them as a `char *` by accident and it eventually makes its way to some code that does expect null termination. There’s languages where you can be quite confident your string will never need null termination… but C is not one of them.
Re: No strcpy either
#37LMAO After all this time the initial AI Slop report was right: https://hackerone.com/reports/2298307
Nonce and websockets don't appear at all in the blog post. The only thing the ai slop got right is that by removing strcpy curl will get less issues [submitted about it].
Re: No strcpy either
#38Earlier quoted context omitted.
Because people are stupid and use AI for things it is not good at.
> people are stupid people overestimate AI
So like why doesn't the person iterate with the AI until they understand the bug (and then ultimately discover it doesn't exist)? Like have any of this bug reports actually paid out? It seems like quickly people should just give up from a lack of rewards.
Re: No strcpy either
#39Earlier quoted context omitted.
> people are stupid people overestimate AI
Its weird though because looking through the hackone reports in the slop wiki page there aren't actually reproduction steps. It's basically always just a line of code and an explanation of how a function can be mis-used but not a "make a webserver that has this hardcoded response". So like why doesn't the person iterate with the AI until they understand the bug (and then ultimately discover it doesn't exist)? Like ha…
Not helped, I imagine, that once you realise it doesn't work, an easy pivot is to start convincing new people that it'll work if they pay you money for a course on it.
Re: No strcpy either
#40I've always wondered at the motivatons of the various string routines in C - every one of them seems to have some huge caveat which makes them useless. After years I now think it's essential to have a library which records at least how much memory is allocated to a string along with the pointer. Something like this: https://github.com/msteinert/bstring
It's from a time before computer viruses no? But also all of this book-keeping takes up extra time and space which is a trade-off easily made nowadays.
Viruses did exist, and these were considered users' fault too.