[Pkg-nagios-changes] [pkg-mod-gearman] 01/48: mod_gearman: prevent empty args leading into a sigsegv with strdup()
Stig Sandbeck Mathisen
ssm at debian.org
Sun Nov 24 22:38:07 UTC 2013
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository pkg-mod-gearman.
commit 735d5358e49ca1e716a27cfe3b086f1d5c91f763
Author: Michael Friedrich <michael.friedrich at netways.de>
Date: Thu Aug 1 18:56:25 2013 +0200
mod_gearman: prevent empty args leading into a sigsegv with strdup()
---
neb_module/mod_gearman.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/neb_module/mod_gearman.c b/neb_module/mod_gearman.c
index c5ed293..66d2196 100644
--- a/neb_module/mod_gearman.c
+++ b/neb_module/mod_gearman.c
@@ -840,8 +840,17 @@ static int read_arguments( const char *args_orig ) {
int verify;
int errors = 0;
char *ptr;
- char *args = strdup(args_orig);
- char *args_c = args;
+ char *args;
+ char *args_c;
+
+ if (args_orig == NULL) {
+ gm_log( GM_LOG_ERROR, "error parsing arguments: none provided.\n" );
+ return GM_ERROR;
+ }
+
+ args = strdup(args_orig);
+ args_c = args;
+
while ( (ptr = strsep( &args, " " )) != NULL ) {
if(parse_args_line(mod_gm_opt, ptr, 0) != GM_OK) {
errors++;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-mod-gearman
More information about the Pkg-nagios-changes
mailing list