summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d0feb43)
raw | patch | inline | side by side (parent: d0feb43)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 20 Jul 2009 07:40:32 +0000 (09:40 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 20 Jul 2009 07:40:32 +0000 (09:40 +0200) |
ping_iterator_get_info()'s 'buffer' argument _may_ be NULL, since the user
might only be interested in the size of the (to be) returned value. If
'buffer' is NULL, '*buffer_len' should be 0, though, to make sure nothing gets
written to 'buffer'.
This bug was introduced in commit 9ae85a09d919777c9be52e55b23c08bf2c8c1d0e.
might only be interested in the size of the (to be) returned value. If
'buffer' is NULL, '*buffer_len' should be 0, though, to make sure nothing gets
written to 'buffer'.
This bug was introduced in commit 9ae85a09d919777c9be52e55b23c08bf2c8c1d0e.
src/liboping.c | patch | blob | history |
diff --git a/src/liboping.c b/src/liboping.c
index 6950103363e052a944a247ea51359f9cb67fa057..411d8669202baf07c57df77e0f8bfb7b5a0cdc87 100644 (file)
--- a/src/liboping.c
+++ b/src/liboping.c
size_t orig_buffer_len = *buffer_len;
- if ((iter == NULL) || (buffer == NULL) || (buffer_len == NULL))
+ if ((iter == NULL) || (buffer_len == NULL))
+ return (-1);
+
+ if ((buffer == NULL) && (*buffer_len != 0 ))
return (-1);
switch (info)