This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][BZ #17657] Return allocated array instead array on stack.


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));
 	}
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]