summaryrefslogtreecommitdiff
path: root/nslcd/invalidator.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2014-05-04 14:38:02 +0200
committerArthur de Jong <arthur@arthurdejong.org>2014-05-04 14:57:09 +0200
commit2274b41dcb6bbb2557ab0e4358a11f1d54da12d7 (patch)
tree553de2872797d8ccf0d1316889e8d7d344f64d34 /nslcd/invalidator.c
parent15fc13ce31cd6455d7c64089425da795da5d51d2 (diff)
Make buffer size error logging consistent
This adds logging of most cases where a defined buffer is not large enough to hold provided data on error log level.
Diffstat (limited to 'nslcd/invalidator.c')
-rw-r--r--nslcd/invalidator.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nslcd/invalidator.c b/nslcd/invalidator.c
index 54a8f95..7e8e415 100644
--- a/nslcd/invalidator.c
+++ b/nslcd/invalidator.c
@@ -1,7 +1,7 @@
/*
invalidator.c - functions for invalidating external caches
- Copyright (C) 2013 Arthur de Jong
+ Copyright (C) 2013-2014 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -85,8 +85,12 @@ static void exec_invalidate(const char *db)
argv[2] = (char *)db;
argv[3] = NULL;
}
- mysnprintf(cmdline, 80, "%s %s%s%s", argv[0], argv[1],
- argv[2] != NULL ? " " : "", argv[2] != NULL ? argv[2] : "");
+ if (mysnprintf(cmdline, 80, "%s %s%s%s", argv[0], argv[1],
+ argv[2] != NULL ? " " : "", argv[2] != NULL ? argv[2] : ""))
+ {
+ log_log(LOG_ERR, "exec_invalidate(): cmdline buffer too small");
+ return;
+ }
log_log(LOG_DEBUG, "invalidator: %s", cmdline);
/* do fork/exec */
switch (cpid=fork())