Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7042 :
authorpascal <pascal@localhost>
Sun, 8 Apr 2012 13:10:45 +0000 (13:10 -0000)
committerpascal <pascal@localhost>
Sun, 8 Apr 2012 13:10:45 +0000 (13:10 -0000)
Handle properly filler and do not remove last digit

svn path=/trunk/; revision=41979

epan/dissectors/packet-gtp.c

index c50fdade31309784cfc8a868f021ba5eee894ae8..1301ba4f8bfb097308b0b0d4679e3b47c3d5e3eb 100644 (file)
@@ -1931,10 +1931,14 @@ msisdn_to_str(tvbuff_t *tvb, gint offset, int len)
             j++;
         if (bits8to5 <= 9)
             str[j++] = BCD2CHAR(bits8to5);
+        else if ((i == (MIN(len, 9) - 1)) && (bits8to5 == 0xF)) {
+            /* filler found (odd number of digits); stop here */
+            break;
+        }
         else
             j++;
     }
-    str[j-1] = '\0';
+    str[j] = '\0';
 
     return str;
 }