]> The Tcpdump Group git mirrors - tcpdump/commitdiff
return-checks: Added a return check for strsep
authoragnosticdev <[email protected]>
Tue, 9 Oct 2018 02:18:52 +0000 (21:18 -0500)
committerGuy Harris <[email protected]>
Sun, 14 Oct 2018 06:26:19 +0000 (23:26 -0700)
(cherry picked from commit 50301a252f4debdbaf1f66f97999a1807ca0e488)

print-esp.c

index d12b97daf10421d9bb3d71a6fcc946d3d0a5f840..fae1e71ff750dc00f6b5f8489224c8d7cb011385 100644 (file)
@@ -398,7 +398,7 @@ espprint_decode_encalgo(netdissect_options *ndo,
 USES_APPLE_RST
 
 /*
 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
  * length. Need to research how openssl looks up HMAC stuff.
  */
 static int
@@ -551,6 +551,10 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
                uint32_t spino;
 
                spistr = strsep(&spikey, "@");
                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) {
 
                spino = strtoul(spistr, &foo, 0);
                if (spistr == foo || !spikey) {