void-packages/srcpkgs/musl/patches/dcngettext-deref-NULL-point...

14 lines
470 B
Diff

Fix a NULL pointer dereference in case CURRENT_LOCALE is not set up properly.
--- src/locale/dcngettext.c.orig 2015-05-18 12:29:14.897996949 +0200
+++ src/locale/dcngettext.c 2015-05-18 12:29:26.730132449 +0200
@@ -132,7 +132,7 @@ char *dcngettext(const char *domainname,
switch (category) {
case LC_MESSAGES:
locname = loc->messages_name;
- if (!*locname) goto notrans;
+ if (!locname || !*locname) goto notrans;
break;
case LC_TIME:
case LC_MONETARY: