This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][BZ #17657] Return allocated array instead array on stack.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Wed, 10 Dec 2014 14:21:53 +0100
- Subject: [PATCH][BZ #17657] Return allocated array instead array on stack.
- Authentication-results: sourceware.org; auth=none
Hi,
here we return array on stack which is invalid. OK to fix it in obvious way?
[BZ #17657]
* locale/programs/ld-ctype.c (find_translit2): Allocate returned array.
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 67846b3..103fc63 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -1777,7 +1777,7 @@ find_translit2 (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
for (wi = tirunp->from; wi <= wch; wi += tirunp->step)
if (wi == wch)
- return (uint32_t []) { 0 };
+ return (uint32_t *) xcalloc (1, sizeof (uint32_t));
}
}