From: Florian Forster Date: Tue, 17 Feb 2009 12:15:39 +0000 (+0100) Subject: src/liboping.c: Fix a (too conservative) off-by-one error in ping_iterator_get_info() X-Git-Tag: liboping-1.0.0~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6ae241903b0605677e104e0a57a0c44df24939c7;p=liboping.git src/liboping.c: Fix a (too conservative) off-by-one error in ping_iterator_get_info() Signed-off-by: Florian Forster --- diff --git a/src/liboping.c b/src/liboping.c index 02125e2..6ffb482 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -1292,7 +1292,7 @@ int ping_iterator_get_info (pingobj_iter_t *iter, int info, case PING_INFO_HOSTNAME: ret = ENOMEM; *buffer_len = strlen (iter->hostname) + 1; - if (orig_buffer_len <= *buffer_len) + if (orig_buffer_len < *buffer_len) break; /* Since (orig_buffer_len > *buffer_len) `strncpy' * will copy `*buffer_len' and pad the rest of