p could be null here.

This commit is contained in:
Roy Marples 2008-04-06 13:21:42 +00:00
parent c18c4fc4cc
commit 5d38d4d6e9

View File

@ -110,7 +110,7 @@ static int do_e(int argc, char **argv)
} else if (strcmp(applet, "esyslog") == 0 || } else if (strcmp(applet, "esyslog") == 0 ||
strcmp(applet, "elog") == 0) { strcmp(applet, "elog") == 0) {
p = strchr(argv[0], '.'); p = strchr(argv[0], '.');
if ((level = syslog_decode(p + 1, prioritynames)) == -1) if (!p || (level = syslog_decode(p + 1, prioritynames)) == -1)
eerrorx("%s: invalid log level `%s'", applet, argv[0]); eerrorx("%s: invalid log level `%s'", applet, argv[0]);
if (argc < 3) if (argc < 3)