Module Name: src Committed By: martin Date: Thu Sep 12 19:41:09 UTC 2024
Modified Files: src/lib/libintl [netbsd-10]: gettext.c Log Message: Pull up following revision(s) (requested by rin in ticket #842): lib/libintl/gettext.c: revision 1.32 PR/58136: Paul Ripke: Fix use after free. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.31.8.1 src/lib/libintl/gettext.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libintl/gettext.c diff -u src/lib/libintl/gettext.c:1.31 src/lib/libintl/gettext.c:1.31.8.1 --- src/lib/libintl/gettext.c:1.31 Thu Oct 3 16:35:57 2019 +++ src/lib/libintl/gettext.c Thu Sep 12 19:41:09 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: gettext.c,v 1.31 2019/10/03 16:35:57 christos Exp $ */ +/* $NetBSD: gettext.c,v 1.31.8.1 2024/09/12 19:41:09 martin Exp $ */ /*- * Copyright (c) 2000, 2001 Citrus Project, @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: gettext.c,v 1.31 2019/10/03 16:35:57 christos Exp $"); +__RCSID("$NetBSD: gettext.c,v 1.31.8.1 2024/09/12 19:41:09 martin Exp $"); #include <sys/param.h> #include <sys/stat.h> @@ -176,6 +176,9 @@ pgettext_impl(const char *domainname, co msgid2, n, category); free(msgctxt_id); + if (translation == msgctxt_id) + return msgid1; + p = strchr(translation, '\004'); if (p) return p + 1;