tupas: fix nil pointer dereference - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 32c6e78c6c4c13b63d8dc30aa395cfcc6e686c0a
(DIR) parent c99867c9e05dd31fce28ae16aad083e893514f5a
(HTM) Author: David du Colombier <0intro@gmail.com>
Date: Thu, 5 Jun 2014 18:46:28 +0200
upas: fix nil pointer dereference
R=rsc
https://codereview.appspot.com/92650043
Diffstat:
M src/cmd/upas/smtp/smtp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/src/cmd/upas/smtp/smtp.c b/src/cmd/upas/smtp/smtp.c
t@@ -229,7 +229,7 @@ threadmain(int argc, char **argv)
for(i = 0; i < argc; i++){
if((trv = rcptto(argv[i])) != 0){
/* remember worst error */
- if(strcmp(rv, Giveup) != 0)
+ if(rv != nil && strcmp(rv, Giveup) != 0)
rv = trv;
errs[rcvrs] = strdup(s_to_c(reply));
removenewline(errs[rcvrs]);
t@@ -241,7 +241,7 @@ threadmain(int argc, char **argv)
}
/* if no ok rcvrs or worst error is retry, give up */
- if(ok == 0 || strcmp(rv, Retry) == 0)
+ if(ok == 0 || (rv != nil && strcmp(rv, Retry) == 0))
goto error;
if(ping){