- Fix a null pointer exception

(asked submitted to send this patch upstream)

PR:             ports/134721
Submitted by:   Dmitry <hanabana@mail.ru>
Approved by:    maintainer timeout (ian@freislich.nom.za; 1.5 months)
This commit is contained in:
Philip M. Gollucci 2009-06-23 23:39:18 +00:00
parent 918e8aad8a
commit 97e4c17bf0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=236560
4 changed files with 53 additions and 1 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= popd
PORTVERSION= 2.2.2a
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= mail
MASTER_SITES= ftp://ftp3.za.freebsd.org/pub/popd/

View file

@ -0,0 +1,30 @@
--- ./lib/mbox_mbf.c.orig 2003-03-05 02:33:12.000000000 -0500
+++ ./lib/mbox_mbf.c 2009-06-23 19:35:15.499808776 -0400
@@ -151,7 +151,10 @@
bytes -= len;
offset += len;
q[buffleft] = '\0';
- p = strchr(buffer, '\n');
+ if ((p = strchr(buffer, '\n')) == NULL) {
+ p = q + buffleft;
+ continue;
+ }
}
*p++ = '\0';
if (*line == '\0') {
@@ -382,7 +385,14 @@
len = read(mbox->fd, offset, buffleft);
bytes -= len;
offset[len] = '\0';
- p = strchr(buffer, '\n');
+ if ((p = strchr(buffer, '\n')) == NULL) {
+ p = offset + len;
+ if( (p - buffer) == 1 && buffer[0] == '.' )
+ sendline(SEND_BUF, "..");
+ else
+ sendline(SEND_BUF, "%s", buffer);
+ continue;
+ }
}
*p++ = '\0';
if (line[0] == '.' && line[1] == '\0') {

View file

@ -0,0 +1,12 @@
--- ./lib/private.h.orig 2001-10-10 05:48:11.000000000 -0400
+++ ./lib/private.h 2009-06-23 19:35:15.499808776 -0400
@@ -26,6 +26,9 @@
* $Id: private.h,v 1.1 2001/10/10 09:48:11 ianf Exp $
*/
+#undef NULL
+#define NULL 0
+
#define TRUE 1
#define FALSE 0
#define MAXINCR 20

View file

@ -0,0 +1,10 @@
--- ./src/config.h.orig 2002-11-20 05:27:49.000000000 -0500
+++ ./src/config.h 2009-06-23 19:35:15.500808903 -0400
@@ -26,6 +26,7 @@
* $Id: config.h,v 1.20 2002/11/20 10:27:49 ianf Exp $
*/
+#undef NULL
#define NULL 0
#define TRUE 1
#define FALSE 0