]> git.kaiwu.me - quickjs.git/commitdiff
intl: removed buffer overflow (#610 point 3)
authorFabrice Bellard <fabrice@bellard.org>
Tue, 10 Nov 2026 10:01:43 +0000 (11:01 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Tue, 10 Nov 2026 10:01:43 +0000 (11:01 +0100)
intl/intl.c

index a2c9edeea58b07801a0c47adfa85698ad2591e39..43be6f24098e1b02899c5f95831afc61f62d147c 100644 (file)
@@ -982,7 +982,7 @@ char *canonicalize_locale(JSContext *ctx, const char *locale)
         strntolower(subtags[i], len);
         /* variant alias mappings */
         if (!strcmp(subtags[i], "heploc"))
-            pstrcpy(subtags[i], sizeof(buf), "alalc97");
+            subtags[i] = (char *)"alalc97";
     }
     {
         /* Special case: hepburn + heploc -> alalc97 (remove hepburn) */