From: Fabrice Bellard Date: Tue, 10 Nov 2026 10:01:43 +0000 (+0100) Subject: intl: removed buffer overflow (#610 point 3) X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=681f105dfd3164c19edb1df3d22587a7a6ba73d9;p=quickjs.git intl: removed buffer overflow (#610 point 3) --- diff --git a/intl/intl.c b/intl/intl.c index a2c9ede..43be6f2 100644 --- a/intl/intl.c +++ b/intl/intl.c @@ -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) */