From: Sebastian Harl Date: Fri, 17 Jul 2009 08:05:38 +0000 (+0200) Subject: src/liboping.c: Let ping_setopt() return -1 if 'value' is NULL. X-Git-Tag: liboping-1.3.0~7^2~2 X-Git-Url: https://git.octo.it/?p=liboping.git;a=commitdiff_plain;h=30ee957b4843140d0d3bae39859d5624824b8feb src/liboping.c: Let ping_setopt() return -1 if 'value' is NULL. The manpage states that 'value' must not be NULL. Anyway, imho, it's still better to avoid segfaults inside a library. --- diff --git a/src/liboping.c b/src/liboping.c index b21188b..36a3a3e 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -1054,6 +1054,9 @@ int ping_setopt (pingobj_t *obj, int option, void *value) { int ret = 0; + if (value == NULL) + return (-1); + switch (option) { case PING_OPT_TIMEOUT: