duplicated code from options.c */ most environment variables will eventually be printed in an error * message if they don't work, and most error message paths go through * BUFSZ buffers, which could be overflowed by a maliciously long * environment variable. If a variable can legitimately be long, or * if it's put in a smaller buffer, the responsible code will have to * bounds-check itself.
| 875 | * bounds-check itself. |
| 876 | */ |
| 877 | char * |
| 878 | nh_getenv(const char *ev) |
| 879 | { |
| 880 | char *getev = getenv(ev); |
| 881 | |
| 882 | if (getev && strlen(getev) <= (BUFSZ / 2)) |
| 883 | return getev; |
| 884 | else |
| 885 | return (char *) 0; |
| 886 | } |
| 887 | |
| 888 | void |
| 889 | done1(int sig_unused UNUSED) |
nothing calls this directly
no outgoing calls
no test coverage detected