Skip to contentSkip to conversation

master - dmfilemapd: use *argv[0] when testing for absolute path (coverity)

PATCH Bryn Reeves 1 participant 1 message Mar 29, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=43fdbb8aeb78f9ada5dc135fa421c344c8e998d3
Commit:        43fdbb8aeb78f9ada5dc135fa421c344c8e998d3
Parent:        b5252a51a5d041a94e712d804a506e94c9a68893
Author:        Bryn M. Reeves <[email protected]>
AuthorDate:    Wed Mar 29 17:03:20 2017 +0100
Committer:     Bryn M. Reeves <[email protected]>
CommitterDate: Wed Mar 29 18:33:42 2017 +0100

dmfilemapd: use *argv[0] when testing for absolute path (coverity)

The path argument check in dmfilemapd incorrectly tests for:

if (argv[0] == '/')

Rather than testing the 1st character in the string pointed to by argv[0].

---
 daemons/dmfilemapd/dmfilemapd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
daemons/dmfilemapd/dmfilemapd.c +1 -1
index fae6a10..0cb0ad7 100644
@@ -305,7 +305,7 @@ static int _parse_args(int argc, char **argv, struct filemap_monitor *fm)
 		return 0;
 	}
 
-	if (argv[0] != '/') {
+	if (*argv[0] != '/') {
 		_early_log("Path argument must specify an absolute path.");
 		return 0;
 	}