3 ms·
argv is defined to be non-const by the standard.
by saagarjha 5y ago
argv is defined to be non-const by the standard.
- josefx 5y agoOne could argue that the main problem here was writing from argv into env^1 , so if one wants to break userland APIs to secure this the best start would be to hit the memory region argv resides in with write protection. ^1 We all know that buffer overflows in C are extremely common so fixing argv[0] alone would be insufficient to fix the majority of bugs.