[PATCH 3/6] depmod: catch trailing spaces on malformed alts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Before, we would let through a line like "moduledir   \n".

Signed-off-by: Keegan McAllister <keegan@xxxxxxxxxxx>
---
 depmod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/depmod.c b/depmod.c
index cbb9992..105df1c 100644
--- a/depmod.c
+++ b/depmod.c
@@ -1401,12 +1401,12 @@ static void parse_alternative(const char *filename,
 
 		if (streq(cmd, "moduledir")) {
 			tmp = strsep_skipspace(&ptr, "\t ");
-			if (!tmp || module_dir)
+			if (!tmp || *tmp == '\0' || module_dir)
 				goto bad_file;
 			module_dir = NOFAIL(strdup(tmp));
 		} else if (streq(cmd, "config")) {
 			tmp = strsep_skipspace(&ptr, "\t ");
-			if (!tmp || config_file)
+			if (!tmp || *tmp == '\0' || config_file)
 				goto bad_file;
 			config_file = NOFAIL(strdup(tmp));
 		} else {
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux