mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
Fix interface bring up message NULL ptr deref
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
6380f17d1f
commit
38619966ee
1 file changed
+7
-5
@@ -107,12 +107,14 @@ static void networking(void)
|
||||
|
||||
/* Bring up all 'auto' interfaces */
|
||||
while (fgets(buf, sizeof(buf), fp)) {
|
||||
chomp(buf);
|
||||
strip_line(buf);
|
||||
char *cmd;
|
||||
|
||||
if (!strncmp(buf, "auto", 4)) {
|
||||
memcpy(buf, "ifup", 4);
|
||||
run_interactive(buf, "Bringing up interface %s", buf[5]);
|
||||
chomp(buf);
|
||||
cmd = strip_line(buf);
|
||||
|
||||
if (!strncmp(cmd, "auto", 4)) {
|
||||
memcpy(cmd, "ifup", 4);
|
||||
run_interactive(cmd, "Bringing up interface %s", &cmd[5]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user