]> git.pld-linux.org Git - packages/poldek.git/commitdiff
- fixes crash on invalid locale (pl.UTF_8 instead of pl.UTF-8)
authorMarcin Banasiak <marcin.banasiak@gmail.com>
Sun, 23 Nov 2008 15:27:53 +0000 (15:27 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    poldek-crash-on-invalid-locale.patch -> 1.1

poldek-crash-on-invalid-locale.patch [new file with mode: 0644]

diff --git a/poldek-crash-on-invalid-locale.patch b/poldek-crash-on-invalid-locale.patch
new file mode 100644 (file)
index 0000000..77ffd3b
--- /dev/null
@@ -0,0 +1,29 @@
+diff -urN poldek-0.30-cvs20080820.23/misc.c poldek-0.30-cvs20080820.23.new/misc.c
+--- poldek-0.30-cvs20080820.23/misc.c  2008-07-19 11:52:31.000000000 +0200
++++ poldek-0.30-cvs20080820.23.new/misc.c      2008-11-23 15:54:42.835970687 +0100
+@@ -626,7 +626,7 @@
+  */
+ static char *cut_country_code (const char *lang)
+ {
+-    char *p, *q, *newlang;
++    char *c, *p, *q, *newlang;
+     if ((q = strchr(lang, '_')) == NULL)
+       return NULL;
+@@ -636,10 +636,12 @@
+     
+     p = n_strncpy(newlang, lang, q - lang + 1);
+     
+-    if ((q = strchr(lang, '.')))
+-      n_strncpy(p, q, strlen(q) + 1);
+-    else if ((q = strchr(lang, '@')))
+-      n_strncpy(p, q, strlen(q) + 1);
++    if ((c = strchr(q, '.')))
++      n_strncpy(p, c, strlen(c) + 1);
++    else if ((c = strchr(q, '@')))
++      n_strncpy(p, c, strlen(c) + 1);
++
++    n_assert(strlen(lang) > strlen(newlang));
+     
+     return newlang;
+ }
This page took 0.17447 seconds and 4 git commands to generate.