diff options
| author | Michael Biebl <biebl@debian.org> | 2019-07-31 10:52:41 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-07-31 10:52:41 +0200 |
| commit | 3a99ba5fd066fe42bd5461360a7411766496619c (patch) | |
| tree | b43863fbe867d7b0f9f9032fd40664c521c88fcb /shared/systemd/src/basic/alloc-util.h | |
| parent | 13cfe714153013158bdf3e74ab58ab713a04223c (diff) | |
| parent | 2e5fa45ddfbb5cffa1e78221f1cea706e2f298af (diff) | |
Update upstream source from tag 'upstream/1.19.90'
Update to upstream version '1.19.90' with Debian dir 6d1a5b9902866beee1365904d425141b5d4c944c
Diffstat (limited to 'shared/systemd/src/basic/alloc-util.h')
| -rw-r--r-- | shared/systemd/src/basic/alloc-util.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shared/systemd/src/basic/alloc-util.h b/shared/systemd/src/basic/alloc-util.h index 9b20be47..64d9e003 100644 --- a/shared/systemd/src/basic/alloc-util.h +++ b/shared/systemd/src/basic/alloc-util.h @@ -58,7 +58,7 @@ static inline void *mfree(void *memory) { }) void* memdup(const void *p, size_t l) _alloc_(2); -void* memdup_suffix0(const void *p, size_t l) _alloc_(2); +void* memdup_suffix0(const void *p, size_t l); /* We can't use _alloc_() here, since we return a buffer one byte larger than the specified size */ #define memdupa(p, l) \ ({ \ @@ -112,7 +112,9 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t size, si return memdup(p, size * need); } -_alloc_(2, 3) static inline void *memdup_suffix0_multiply(const void *p, size_t size, size_t need) { +/* Note that we can't decorate this function with _alloc_() since the returned memory area is one byte larger + * than the product of its parameters. */ +static inline void *memdup_suffix0_multiply(const void *p, size_t size, size_t need) { if (size_multiply_overflow(size, need)) return NULL; |