Message ID | 20141210132153.GA6395@domone |
---|---|
State | New |
Headers | show |
Ondřej Bílka <neleai@seznam.cz> writes:
> here we return array on stack which is invalid. OK to fix it in obvious way?
The obvious way would be a static allocation.
Andreas.
On Wed, Dec 10, 2014 at 03:09:53PM +0100, Andreas Schwab wrote: > Ondřej Bílka <neleai@seznam.cz> writes: > > > here we return array on stack which is invalid. OK to fix it in obvious way? > > The obvious way would be a static allocation. > which breaks when user modifies array.
Ondřej Bílka <neleai@seznam.cz> writes: > On Wed, Dec 10, 2014 at 03:09:53PM +0100, Andreas Schwab wrote: >> Ondřej Bílka <neleai@seznam.cz> writes: >> >> > here we return array on stack which is invalid. OK to fix it in obvious way? >> >> The obvious way would be a static allocation. >> > which breaks when user modifies array. Which user? Andreas.
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)); } }