From 4927109a739edd57a5c7eb4311127e5349dcaba2 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Thu, 30 Apr 2015 14:05:21 -0400 Subject: nfsidmap: make sure give arguments are valid Detect when a given argument is invalid. Log the error and exit gracefully Signed-off-by: Steve Dickson --- utils/nfsidmap/nfsidmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c index 5d62078..1f5ba67 100644 --- a/utils/nfsidmap/nfsidmap.c +++ b/utils/nfsidmap/nfsidmap.c @@ -323,7 +323,10 @@ int main(int argc, char **argv) } type = strtok(arg, ":"); value = strtok(NULL, ":"); - + if (value == NULL) { + xlog_err("Error: Null uid/gid value."); + return 1; + } if (verbose) { xlog_warn("key: 0x%lx type: %s value: %s timeout %ld", key, type, value, timeout); -- cgit