From 6ae241903b0605677e104e0a57a0c44df24939c7 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 17 Feb 2009 13:15:39 +0100 Subject: [PATCH] src/liboping.c: Fix a (too conservative) off-by-one error in ping_iterator_get_info() Signed-off-by: Florian Forster --- src/liboping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2