diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-02 00:33:44 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-02 00:33:44 +0100 |
commit | 2aab906790a3d73b791cb3f2af91fe41ad641994 (patch) | |
tree | 81a068c167e01c69712bb0d0563dc0afe78acff4 /libshouldbeinlibc | |
parent | 4f523e2b5004a0ae6e01d83b64b9f093a371848a (diff) | |
download | hurd-2aab906790a3d73b791cb3f2af91fe41ad641994.tar.gz hurd-2aab906790a3d73b791cb3f2af91fe41ad641994.tar.bz2 hurd-2aab906790a3d73b791cb3f2af91fe41ad641994.zip |
Avoid passing NULL to memcpy
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r-- | libshouldbeinlibc/idvec.c | 3 |
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; |