Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libintl provide sizes so that we don't truncate accident...



details:   https://anonhg.NetBSD.org/src/rev/4b7f78213d8f
branches:  trunk
changeset: 459975:4b7f78213d8f
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 03 16:35:57 2019 +0000

description:
provide sizes so that we don't truncate accidentally.

diffstat:

 lib/libintl/gettext.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 998d1fe105b7 -r 4b7f78213d8f lib/libintl/gettext.c
--- a/lib/libintl/gettext.c     Thu Oct 03 16:10:23 2019 +0000
+++ b/lib/libintl/gettext.c     Thu Oct 03 16:35:57 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gettext.c,v 1.30 2019/02/04 08:21:11 mrg Exp $ */
+/*     $NetBSD: gettext.c,v 1.31 2019/10/03 16:35:57 christos Exp $    */
 
 /*-
  * Copyright (c) 2000, 2001 Citrus Project,
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: gettext.c,v 1.30 2019/02/04 08:21:11 mrg Exp $");
+__RCSID("$NetBSD: gettext.c,v 1.31 2019/10/03 16:35:57 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -229,6 +229,7 @@
        return NULL;
 }
 
+#define MAXBUFLEN      1024
 /*
  * XPG syntax: language[_territory[.codeset]][@modifier]
  * XXX boundary check on "result" is lacking
@@ -236,9 +237,9 @@
 static const char *
 split_locale(const char *lname)
 {
-       char buf[BUFSIZ], tmp[BUFSIZ];
+       char buf[MAXBUFLEN], tmp[2 * MAXBUFLEN];
        char *l, *t, *c, *m;
-       static char result[BUFSIZ];
+       static char result[4 * MAXBUFLEN];
 
        memset(result, 0, sizeof(result));
 



Home | Main Index | Thread Index | Old Index