aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2014-06-05 18:46:28 +0200
committerDavid du Colombier <0intro@gmail.com>2014-06-05 18:46:28 +0200
commit32c6e78c6c4c13b63d8dc30aa395cfcc6e686c0a (patch)
tree4f5dca39ffff2c145c027b67f0e8f86763a52dcb /src/cmd/upas
parentc99867c9e05dd31fce28ae16aad083e893514f5a (diff)
downloadplan9port-32c6e78c6c4c13b63d8dc30aa395cfcc6e686c0a.tar.gz
plan9port-32c6e78c6c4c13b63d8dc30aa395cfcc6e686c0a.tar.bz2
plan9port-32c6e78c6c4c13b63d8dc30aa395cfcc6e686c0a.zip
upas: fix nil pointer dereference
R=rsc https://codereview.appspot.com/92650043
Diffstat (limited to 'src/cmd/upas')
-rw-r--r--src/cmd/upas/smtp/smtp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/upas/smtp/smtp.c b/src/cmd/upas/smtp/smtp.c
index 62ef865e..9dd05596 100644
--- a/src/cmd/upas/smtp/smtp.c
+++ b/src/cmd/upas/smtp/smtp.c
@@ -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]);
@@ -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){