|
From: Andraž 'r. L. <ru...@co...> - 2009-06-09 16:50:20
|
:2009-06-09T08:25:Mark Crispin:
> Here's my present for the project. I already fixed this in Panda IMAP.
> Rather than submit a patch, I'll tell you what the problem is and let you
> figure it out. It shouldn't be difficult. If you like, I'll review your
> patch after you do it and tell you if it's right.
>
> The problems are in imap/src/c-client/imap4r1.c and are caused by
> references to null pointers.
>
> [1] The code block starting at line 3722:
> else if ((!strcmp (s,"FETCH") || !strcmp (s,"STORE")) &&
> msgno && (msgno <= stream->nmsgs)) {
> assumes that t has a pointer to the response values. However, t can be
> null at this point.
>
> Just include a condition for t being non-null in this if test.
>
diff --git a/imap/src/c-client/imap4r1.c b/imap/src/c-client/imap4r1.c
index b938984..d21070c 100644
--- a/imap/src/c-client/imap4r1.c
+++ b/imap/src/c-client/imap4r1.c
@@ -3720,7 +3720,7 @@ void imap_parse_unsolicited (MAILSTREAM *stream,IMAPPARSEDREPLY *r
}
else if ((!strcmp (s,"FETCH") || !strcmp (s,"STORE")) &&
- msgno && (msgno <= stream->nmsgs)) {
+ msgno && (msgno <= stream->nmsgs)) && ((t != NULL)){
char *prop;
GETS_DATA md;
ENVELOPE **e;
If I've read point 1 correctly this looks like the code that you said
should go there?
Still trying to figure out point 2. I only had like 3 months of C
in-between a pile of Java.
--
Andraž ruskie Levstik
Source Mage GNU/Linux Games/Xorg grimoire guru
Re-Alpine Coordinator http://sourceforge.net/projects/re-alpine/
Geek/Hacker/Tinker
Quis custodiet ipsos custodies. |