Fix -Wsometimes-uninitialized found by Clang
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 14 Jan 2014 17:44:21 +0000 (17:44 -0000)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 14 Jan 2014 17:44:21 +0000 (17:44 -0000)
packet-pdcp-lte.c:1397:9: error: variable 'decrypted_data' is used uninitialized whenever 'if' condition is false
packet-pdcp-lte.c:1469:50: note: uninitialized use occurs here
    decrypted_tvb = tvb_new_child_real_data(tvb, decrypted_data, payload_length, payload_length);
packet-pdcp-lte.c:1353:27: note: initialize the variable 'decrypted_data' to silence this warning

packet-pdcp-lte.c:1397:9: error: variable 'payload_length' is used uninitialized whenever 'if' condition is false
packet-pdcp-lte.c:1469:66: note: uninitialized use occurs here
    decrypted_tvb = tvb_new_child_real_data(tvb, decrypted_data, payload_length, payload_length);
packet-pdcp-lte.c:1354:24: note: initialize the variable 'payload_length' to silence this warning

svn path=/trunk/; revision=54791

epan/dissectors/packet-pdcp-lte.c

index da1896893774cce856e49e0f076402984d3c0733..fe64f6b251c5cf53027c036dc0c82dad554180e8 100644 (file)
@@ -1350,8 +1350,8 @@ static tvbuff_t *decipher_payload(tvbuff_t *tvb, packet_info *pinfo, int *offset
                                   enum pdcp_plane plane, gboolean will_be_deciphered,
                                   gboolean *deciphered)
 {
-    guint8* decrypted_data;
-    gint payload_length;
+    guint8* decrypted_data = NULL;
+    gint payload_length = 0;
     tvbuff_t *decrypted_tvb;
 
     /* Nothing to do if NULL ciphering */