Package: uw-imap
Version: 8:2007e~dfsg-3.1
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu oneiric ubuntu-patch

In Ubuntu, the attached patch was applied to achieve the following:

  * Apply patch from Vladimir Kolesnikov to properly zero out len
    parameter when mail_fetch_body() returns an empty string.
    (LP: #617876)


Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric-updates
  APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 
'oneiric-proposed'), (500, 'oneiric')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-7-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u uw-imap-2007e~dfsg/debian/patches/series uw-imap-2007e~dfsg/debian/patches/series
--- uw-imap-2007e~dfsg/debian/patches/series
+++ uw-imap-2007e~dfsg/debian/patches/series
@@ -5,0 +6 @@
+1110_properly_zero_len_when_mail_fetch_body_is_empty.patch
--- uw-imap-2007e~dfsg.orig/debian/patches/1110_properly_zero_len_when_mail_fetch_body_is_empty.patch
+++ uw-imap-2007e~dfsg/debian/patches/1110_properly_zero_len_when_mail_fetch_body_is_empty.patch
@@ -0,0 +1,24 @@
+Description: Properly zero out len when mail_fetch_body() returns an empty string
+Forwarded: no
+Origin: Vladimir Kolesnikov, https://bugs.launchpad.net/ubuntu/+source/uw-imap/+bug/617876/+attachment/1489969/+files/mail.c.diff
+Author: Vladimir Kolesnikov
+Reviewed-By: Daniel T Chen <[email protected]>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/uw-imap/+bug/617876
+Last-Update: 2011-07-28
+
+Index: uw-imap-2007e~dfsg/src/c-client/mail.c
+===================================================================
+--- uw-imap-2007e~dfsg.orig/src/c-client/mail.c	2011-07-28 18:30:59.000000000 -0400
++++ uw-imap-2007e~dfsg/src/c-client/mail.c	2011-07-28 18:34:25.000000000 -0400
+@@ -1938,7 +1938,10 @@
+   memset (&stream->private.string,NIL,sizeof (STRING));
+   if (!(section && *section))	/* top-level text wanted? */
+     return mail_fetch_message (stream,msgno,len,flags);
+-  else if (strlen (section) > (MAILTMPLEN - 20)) return "";
++  else if (strlen (section) > (MAILTMPLEN - 20)) {
++    if (len) *len = 0;
++    return "";
++  }
+   flags &= ~FT_INTERNAL;	/* can't win with this set */
+ 				/* initialize message data identifier */
+   INIT_GETS (md,stream,msgno,section,0,0);

Reply via email to