Barry Schwarz
3/26/2011 12:07:00 AM
On Fri, 25 Mar 2011 16:51:21 -0700 (PDT), Why Tea <ytlim1@gmail.com>
wrote:
>When a program receives its command line arguments,
>e.g. -abc some_value, is it safe to change "-abc"
>to "--abc"? In general, how safe is it to extend an
>argv to less than MAX_ARG_STRLEN?
Paragraph 5.1.2.2.1-2 guarantees that you can change the value of the
5 bytes in the string "-abc". It does not say anything about the
memory that follows the string. It is entirely possible for the "6th
byte" to be part of the next command line argument. It is also
possible for the bytes that follow the string to hold system specific
data needed when main returns to your host environment.
All in all it sounds like a really bad idea (tm).
--
Remove del for email