odb-ii: Fix Dereference of null pointer found by Clang analyzer
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 16 May 2017 20:15:46 +0000 (22:15 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Thu, 18 May 2017 17:33:26 +0000 (17:33 +0000)
Change-Id: Ic19a59efffba1f19d3469445e8733fce8ab4cf98
Reviewed-on: https://code.wireshark.org/review/21689
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
epan/dissectors/packet-obd-ii.c

index 3618fb01359c395bf8a5c7a2d0c9c95623d88bcf..ef3eab9f49b54543935832d2f1509e7007c36a9a 100644 (file)
@@ -1250,7 +1250,7 @@ dissect_obdii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
        guint8 mode;
 
        /* validate */
-       if (!can_id && !(can_id->id == ODBII_CAN_QUERY_ID || (can_id->id >= ODBII_CAN_RESPONSE_ID_MIN && can_id->id <= ODBII_CAN_RESPONSE_ID_MAX)))
+       if (!can_id || !(can_id->id == ODBII_CAN_QUERY_ID || (can_id->id >= ODBII_CAN_RESPONSE_ID_MIN && can_id->id <= ODBII_CAN_RESPONSE_ID_MAX)))
                return 0;
 
        if (tvb_reported_length(tvb) != 8)