diff options
| author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2025-04-21 17:51:37 -0300 |
|---|---|---|
| committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2025-04-25 17:46:05 -0300 |
| commit | 8e2b4fb6912b7cf5dcb936cebef99bf44d807201 (patch) | |
| tree | 164604f162fa722f6558680ae52509ba6fb1f655 | |
| parent | a3358fc2dca39add4581cca6997395ed30c5a40f (diff) | |
| download | glibc-8e2b4fb6912b7cf5dcb936cebef99bf44d807201.tar.xz glibc-8e2b4fb6912b7cf5dcb936cebef99bf44d807201.zip | |
iconv: Fix UB on iconv/tst-translit-mchar
Building with ubsan, the test triggers:
UBSAN: Undefined behaviour in programs/locfile.c:598:3 null pointer passed as argument 2, nonnull attribute declared at unknown:0:0
The obstack_grow is only define for size > 0.
| -rw-r--r-- | locale/programs/locfile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c index 7907c949ea..0b66a6bde1 100644 --- a/locale/programs/locfile.c +++ b/locale/programs/locfile.c @@ -595,6 +595,8 @@ void add_locale_raw_data (struct locale_file *file, const void *data, size_t size) { record_offset (file); + if (size == 0) + return; obstack_grow (&file->data, data, size); } |
