4 ms·
Wait what bugs are caused by argv's null termination? Aren't all these bugs caused by the fact that argc can be 0 and programs don't expect that, not that argv
by mort96 3y ago
Wait what bugs are caused by argv's null termination? Aren't all these bugs caused by the fact that argc can be 0 and programs don't expect that, not that argv is null terminated?
- hardware2win 3y agoIt is ugly as hell Whenever I see >while char != NULL Im a little bit sad. It doesnt feel robust.
- josefx 3y agoRelying on argc instead of null termination is a bit more robust since the check will still work even if you skip entries for any reason.
- mort96 3y agoI agree that using argc is better than null termination, but I don't understand how any of the bugs related to argc==0 are about null termination. Note that the buggy code behind CVE-2021-4034 literally uses argc, not null termination.