aboutsummaryrefslogtreecommitdiff
path: root/libshouldbeinlibc
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-02 00:33:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-02 00:33:44 +0100
commit2aab906790a3d73b791cb3f2af91fe41ad641994 (patch)
tree81a068c167e01c69712bb0d0563dc0afe78acff4 /libshouldbeinlibc
parent4f523e2b5004a0ae6e01d83b64b9f093a371848a (diff)
downloadhurd-2aab906790a3d73b791cb3f2af91fe41ad641994.tar.gz
hurd-2aab906790a3d73b791cb3f2af91fe41ad641994.tar.bz2
hurd-2aab906790a3d73b791cb3f2af91fe41ad641994.zip
Avoid passing NULL to memcpy
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r--libshouldbeinlibc/idvec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libshouldbeinlibc/idvec.c b/libshouldbeinlibc/idvec.c
index 63f59f62..84131a62 100644
--- a/libshouldbeinlibc/idvec.c
+++ b/libshouldbeinlibc/idvec.c
@@ -163,7 +163,8 @@ idvec_set_ids (struct idvec *idvec, const uid_t *ids, unsigned num)
err = idvec_ensure (idvec, num);
if (!err)
{
- memcpy (idvec->ids, ids, num * sizeof (uid_t));
+ if (num)
+ memcpy (idvec->ids, ids, num * sizeof (uid_t));
idvec->num = num;
}
return err;