From 743332ab9fb2411f4676b35af2c2a0dfadee5f69 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 14 Dec 2009 08:01:57 -0800 Subject: [PATCH] HAMMER Utility - Fix seg-fault in hammer cleanup if blank lines in config * If the HAMMER config contained blank lines the hammer cleanup directive would seg-fault trying to parse it. * Ignore blank lines. Also ignore lines beginning with a '#' when parsing the config. Reported-by: elekktretterr@exemail.com.au --- sbin/hammer/cmd_cleanup.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/sbin/hammer/cmd_cleanup.c b/sbin/hammer/cmd_cleanup.c index 6a198f2..e5d9e2d 100644 --- a/sbin/hammer/cmd_cleanup.c +++ b/sbin/hammer/cmd_cleanup.c @@ -396,6 +396,9 @@ do_cleanup(const char *path) cbase = cptr + 1; cmd = strtok(buf, WS); + if (cmd == NULL || cmd[0] == '#') + continue; + arg1 = 0; arg2 = 0; arg3 = NULL; -- 1.7.7.2