[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-2.1.1-30-g3210054

by Werner Koch cvs at cvs.gnupg.org
Mon Jul 15 16:09:26 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG for Windows".

The branch, master has been updated
       via  32100547c950d58bce865cda1ac45e4bef462c13 (commit)
      from  45dc32b6c09e836d6244ddf95852101280e91658 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 32100547c950d58bce865cda1ac45e4bef462c13
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jul 10 15:18:00 2013 +0200

    Add patch for libgcrypt 1.12.
    
    --

diff --git a/Makefile.am b/Makefile.am
index 698b57d..03eb2cb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,7 +47,8 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/claws-mail-3.9.1/51-version-file.patch \
         patches/claws-mail-3.9.1/80-src-makefile.postcfg-build \
         patches/gtkhtml2_viewer-0.34/80-src-makefile.postcfg-build \
-	patches/gnutls-2.12.21/01-openssl-wincrypt.patch
+	patches/gnutls-2.12.21/01-openssl-wincrypt.patch \
+        patches/libgpg-error-1.12/01-fix-get-string.patch
 
 copy-news:
 	cp NEWS doc/website/NEWS.last
diff --git a/patches/libgpg-error-1.12/01-fix-get-string.patch b/patches/libgpg-error-1.12/01-fix-get-string.patch
new file mode 100755
index 0000000..7ec0b5e
--- /dev/null
+++ b/patches/libgpg-error-1.12/01-fix-get-string.patch
@@ -0,0 +1,75 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 52e1f2e131b422fdb66abeaf4a8f084689b39bf7 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk at gnupg.org>
+Date: Mon, 15 Jul 2013 15:31:55 +0200
+Subject: [PATCH] w32: Fix corrupted string output.
+
+* src/w32-gettext.c (get_string): Pass the nul of the utf-8 string to
+the conversion function but keep TRANSLEN without the nul.
+--
+
+The bug first occurred on Windows 8 but it is a real thing.  Assuming
+that a malloced buffer is zeroed out is not solid assumptions ;-)
+---
+ src/w32-gettext.c |   22 ++++++++++++++++++----
+ 1 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/src/w32-gettext.c b/src/w32-gettext.c
+index 936cafe..89f505d 100644
+--- a/src/w32-gettext.c
++++ b/src/w32-gettext.c
+@@ -1617,6 +1617,17 @@ get_string (struct loaded_domain *domain, uint32_t idx,
+                 + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
+       plen_utf8 = SWAPIT(domain->must_swap, domain->trans_tab[idx].length);
+
++      /* We need to include the nul, so that the utf8->wchar->native
++         conversion chain works correctly and the nul is stored after
++         the conversion. */
++      if (p_utf8[plen_utf8])
++        {
++          trans = "ERROR in MO file"; /* Terminating zero is missing.  */
++          translen = 0;
++          goto leave;
++        }
++      plen_utf8++;
++
+       buf = utf8_to_native (p_utf8, plen_utf8, &buflen);
+       if (!buf)
+         {
+@@ -1640,10 +1651,10 @@ get_string (struct loaded_domain *domain, uint32_t idx,
+           /* There is not enough space for the translation (or for
+              whatever reason an empty string is used): Store it in the
+              overflow_space and mark that in the mapped array.
+-             Because UTF-8 strings are in general shorter than the
+-             Windows 2 byte encodings, we expect that this won't
+-             happen too often (if at all) and thus we use a linked
+-             list to manage this space. */
++             Because UTF-8 strings are in general longer than the
++             Windows native encoding, we expect that this won't happen
++             too often and thus we use a linked list to manage this
++             space. */
+           os = jnlib_malloc (sizeof *os + buflen);
+           if (os)
+             {
+@@ -1662,6 +1673,8 @@ get_string (struct loaded_domain *domain, uint32_t idx,
+               translen = 0;
+             }
+         }
++      if (translen)
++        translen--;  /* TRANSLEN shall be the size without the nul.  */
+       jnlib_free (buf);
+     }
+   else if (domain->mapped[idx] == 1)
+@@ -1688,6 +1701,7 @@ get_string (struct loaded_domain *domain, uint32_t idx,
+       translen = domain->mapped[idx];
+     }
+
++ leave:
+   if (use_plural && translen)
+     return get_plural (trans, translen, nplural);
+   else
+--
+1.7.7.1

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                       |    3 +-
 patches/libgpg-error-1.12/01-fix-get-string.patch |   75 +++++++++++++++++++++
 2 files changed, 77 insertions(+), 1 deletions(-)
 create mode 100755 patches/libgpg-error-1.12/01-fix-get-string.patch


hooks/post-receive
-- 
GnuPG for Windows
http://git.gnupg.org



More information about the Gpg4win-commits mailing list