From fb9b398d0e3ec2ff3b882298dd18d4696d051787 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 4 Dec 2002 04:12:42 +0000 Subject: need to initialize the pointers, otherwise they have random junk in them which throws off the other logic here --- loader2/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'loader2') diff --git a/loader2/net.c b/loader2/net.c index da55d7a5f..ff27f3f4f 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -591,7 +591,7 @@ int findHostAndDomain(struct networkDeviceConfig * dev, int flags) { void setKickstartNetwork(struct loaderData_s * loaderData, int argc, char ** argv, int * flagsPtr) { - char * arg, * bootProto, * device; + char * arg, * bootProto = NULL, * device = NULL;; int noDns = 0, rc; poptContext optCon; @@ -644,7 +644,8 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc, /* if they've specified dhcp/bootp or haven't specified anything, * use dhcp for the interface */ - if (!strncmp(bootProto, "dhcp", 4) || !strncmp(bootProto, "bootp", 4) || + if ((bootProto && (!strncmp(bootProto, "dhcp", 4) || + !strncmp(bootProto, "bootp", 4))) || (!bootProto && !loaderData->ip)) { loaderData->ip = strdup("dhcp"); loaderData->ipinfo_set = 1; -- cgit