Skip to contentSkip to conversation

Fix environ termination

PATCH New Andreas Schwab 1 participant 1 message Jun 27, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix environ termination

Properly NULL-terminate the environment.

Andreas.

main.c renamed from main.c.~1.116.~ +1 -1
@@ -1819,7 +1819,7 @@ int main(int argc, char **argv)
             continue;
         *(dst++) = strdup(*wrk);
     }
-    dst = NULL; /* NULL terminate target_environ */
+    *dst = NULL; /* NULL terminate target_environ */
 
     if (loader_exec(filename, argv+optind, target_environ, regs, info) != 0) {
         printf("Error loading %s\n", filename);
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."