summaryrefslogtreecommitdiff
path: root/src/libstddjb/siovec_gather.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-12-18 13:41:53 +0000
committerLaurent Bercot <ska@appnovation.com>2023-12-18 13:41:53 +0000
commit37b38dadd77079cd7e537f247dcb0a45301e539b (patch)
tree08460e459bc8a5daad9d5abeee28ec6ecacb07ff /src/libstddjb/siovec_gather.c
parent8aae9ebac033ad235ef213c4a3073d7bca9a2611 (diff)
downloadskalibs-37b38dadd77079cd7e537f247dcb0a45301e539b.tar.xz
Fix more small UBs
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/siovec_gather.c')
-rw-r--r--src/libstddjb/siovec_gather.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/siovec_gather.c b/src/libstddjb/siovec_gather.c
index a037b0c..4288141 100644
--- a/src/libstddjb/siovec_gather.c
+++ b/src/libstddjb/siovec_gather.c
@@ -12,7 +12,7 @@ size_t siovec_gather (struct iovec const *v, unsigned int n, char *s, size_t max
{
size_t len = v[i].iov_len ;
if (len > max - w) len = max - w ;
- memmove(s + w, v[i].iov_base, len) ;
+ if (len) memmove(s + w, v[i].iov_base, len) ;
w += len ;
}
return w ;