/[gentoo-x86]/x11-plugins/wmbiff/files/wmbiff-0.4.27-invalid-strncpy.patch
Gentoo

Contents of /x11-plugins/wmbiff/files/wmbiff-0.4.27-invalid-strncpy.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jul 4 20:10:14 2012 UTC (10 months, 2 weeks ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Fix mbox access, patch by Mikael Magnusson in bug #383189. Remove gnutls_certificate_verify_peers calls and LZO compression for gnutls-3 support, bug #424675

(Portage version: 2.2.0_alpha115/cvs/Linux x86_64)

1 This corrupted the path for me before, so it couldn't find the file. Presumably since the glibc change to copy stuff backwards.
2
3 diff -pudr wmbiff-0.4.27/wmbiff/mboxClient.c wmbiff-0.4.27-mik/wmbiff/mboxClient.c
4 --- wmbiff-0.4.27/wmbiff/mboxClient.c 2004-03-28 01:28:58.000000000 +0100
5 +++ wmbiff-0.4.27-mik/wmbiff/mboxClient.c 2011-09-16 09:54:22.834144487 +0200
6 @@ -149,7 +149,10 @@ int mboxCreate(Pop3 pc, const char *str)
7 DM(pc, DEBUG_ERROR, "mbox '%s' is too long.\n", str + 5);
8 memset(pc->path, 0, BUF_BIG);
9 } else {
10 - strncpy(pc->path, str + 5, BUF_BIG - 1); /* cut off ``mbox:'' */
11 + /* str is always pc.path, so we can't use strncpy */
12 + int len = strlen(str + 5);
13 + memmove(pc->path, str + 5, min(len, BUF_BIG - 1)); /* cut off ``mbox:'' */
14 + pc->path[len] = '\0';
15 }
16 }
17

  ViewVC Help
Powered by ViewVC 1.1.13