If someone tries to invoke the program with too many arguments, the exec*()
operation fails and your program is not run. Thus, your program will only ever be invoked with a list of arguments that fits into the space available for arguments plus environment variables.
If your program tries to invoke another program and your program creates too big an argument list, then your program will fail to exec*()
the other because the arguments plus environment are too big, getting error E2BIG.
You might theoretically run into memory allocation problems copying the argument list into a vector of strings, but it is relatively unlikely. The actual limit is about 128 KiB on Linux and about 256 KiB on Mac OS X.