From 30ee957b4843140d0d3bae39859d5624824b8feb Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 17 Jul 2009 10:05:38 +0200 Subject: [PATCH] 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. --- src/liboping.c | 3 +++ 1 file changed, 3 insertions(+) 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: -- 2.30.2