summaryrefslogtreecommitdiff
path: root/print-esp.c
diff options
context:
space:
mode:
authoragnosticdev <agnosticdev@gmail.com>2018-10-08 21:18:52 -0500
committeragnosticdev <agnosticdev@gmail.com>2018-10-08 21:18:52 -0500
commit50301a252f4debdbaf1f66f97999a1807ca0e488 (patch)
tree51ef16dea4c5e2d82fcec2c206e35b20834bc578 /print-esp.c
parent51eefc7c84f6791de120c3944387cff1c16a84de (diff)
downloadtcpdump-50301a252f4debdbaf1f66f97999a1807ca0e488.tar.gz
return-checks: Added a return check for malloc and for strsep
Diffstat (limited to 'print-esp.c')
-rw-r--r--print-esp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/print-esp.c b/print-esp.c
index 774ec72c..e5a490f5 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -424,7 +424,7 @@ espprint_decode_encalgo(netdissect_options *ndo,
USES_APPLE_RST
/*
- * for the moment, ignore the auth algorith, just hard code the authenticator
+ * for the moment, ignore the auth algorithm, just hard code the authenticator
* length. Need to research how openssl looks up HMAC stuff.
*/
static int
@@ -577,6 +577,10 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
uint32_t spino;
spistr = strsep(&spikey, "@");
+ if (spistr == NULL) {
+ (*ndo->ndo_warning)(ndo, "print_esp: failed to find the @ token");
+ return;
+ }
spino = strtoul(spistr, &foo, 0);
if (spistr == foo || !spikey) {