about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-07-12 15:55:19 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-07-12 15:55:19 +0000
commit04ce2440d5cab09bbec99fc1e693b8c43193cfe6 (patch)
tree39b37d36a8f8abf2ce7d05c1d77f17c3de253c61 /src
parent62003152d624eb3b64ceb6fdfa3722d128020ba4 (diff)
downloads6-04ce2440d5cab09bbec99fc1e693b8c43193cfe6.tar.gz
s6-04ce2440d5cab09bbec99fc1e693b8c43193cfe6.tar.xz
s6-04ce2440d5cab09bbec99fc1e693b8c43193cfe6.zip
- doc typo fix
 - bugfix: proper error reporting in s6_fdholder_list_cb
Diffstat (limited to 'src')
-rw-r--r--src/libs6/s6_fdholder_list_cb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs6/s6_fdholder_list_cb.c b/src/libs6/s6_fdholder_list_cb.c
index d465004..59d01a5 100644
--- a/src/libs6/s6_fdholder_list_cb.c
+++ b/src/libs6/s6_fdholder_list_cb.c
@@ -13,12 +13,13 @@ int s6_fdholder_list_cb (unixmessage_t const *m, void *p)
   uint32 n ;
   register s6_fdholder_list_result_t *res = p ;
   if (m->nfds) goto droperr ;
-  if (m->len < 5) goto err ;
+  if (!m->len) goto err ;
   if (m->s[0])
   {
     res->err = m->s[0] ;
     return 1 ;
   }
+  if (m->len < 5) goto err ;
   uint32_unpack_big(m->s + 1, &n) ;
   if (byte_count(m->s + 5, m->len - 5, 0) != n) goto err ;
   if (!stralloc_catb(res->sa, m->s + 5, m->len - 5)) return 0 ;