mozilla-icu-strncat.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Thu, 17 Apr 2014 23:08:54 +0200
branchfirefox29
changeset 717 c18c0e8dbac7
parent 716 cef565f1c325
child 869 0dd25a92df97
permissions -rw-r--r--
update to 29.0b8

# HG changeset patch
# Parent 29be2a4daa0f512d22bde85b97b5460839026571
# User Wolfgang Rosenauer <wr@rosenauer.org>
From: Jan Engelhardt <jengelh@inai.de>
Reference: http://bugs.icu-project.org/trac/ticket/7808

diff --git a/intl/icu/source/tools/pkgdata/pkgdata.cpp b/intl/icu/source/tools/pkgdata/pkgdata.cpp
--- a/intl/icu/source/tools/pkgdata/pkgdata.cpp
+++ b/intl/icu/source/tools/pkgdata/pkgdata.cpp
@@ -1975,22 +1975,22 @@ static void loadLists(UPKGOptions *o, UE
     FILE *p = NULL;
     size_t n;
     static char buf[512] = "";
     char cmdBuf[1024];
     UErrorCode status = U_ZERO_ERROR;
     const char cmd[] = "icu-config --incpkgdatafile";
 
     /* #1 try the same path where pkgdata was called from. */
-    findDirname(progname, cmdBuf, 1024, &status);
+    findDirname(progname, cmdBuf, sizeof(cmdBuf), &status);
     if(U_SUCCESS(status)) {
       if (cmdBuf[0] != 0) {
-          uprv_strncat(cmdBuf, U_FILE_SEP_STRING, 1024);
+          uprv_strncat(cmdBuf, U_FILE_SEP_STRING, sizeof(cmdBuf)-1-strlen(cmdBuf));
       }
-      uprv_strncat(cmdBuf, cmd, 1024);
+      uprv_strncat(cmdBuf, cmd, sizeof(cmdBuf)-1-strlen(cmdBuf));
       
       if(verbose) {
         fprintf(stdout, "# Calling icu-config: %s\n", cmdBuf);
       }
       p = popen(cmdBuf, "r");
     }
 
     if(p == NULL || (n = fread(buf, 1, 511, p)) <= 0) {