summaryrefslogtreecommitdiffstats
path: root/wiretap/log3gpp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:15:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:15:59 +0000
commit489b73a4c69e01167e693d7153f973105c613c30 (patch)
tree5d72d5ab3cf7dd8efa4e1733579d216d79c8ad66 /wiretap/log3gpp.c
parentReleasing progress-linux version 4.2.5-2~progress7.99u1. (diff)
downloadwireshark-489b73a4c69e01167e693d7153f973105c613c30.tar.xz
wireshark-489b73a4c69e01167e693d7153f973105c613c30.zip
Merging upstream version 4.2.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wiretap/log3gpp.c')
-rw-r--r--wiretap/log3gpp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/wiretap/log3gpp.c b/wiretap/log3gpp.c
index 4754d6c2..6fb21f6f 100644
--- a/wiretap/log3gpp.c
+++ b/wiretap/log3gpp.c
@@ -503,7 +503,7 @@ gboolean parse_line(gchar* linebuff, gint line_length, gint *seconds, gint *usec
int prot_option_chars = 0;
char seconds_buff[MAX_SECONDS_CHARS+1];
int seconds_chars;
- char subsecond_decimals_buff[MAX_SUBSECOND_DECIMALS+1];
+ char subsecond_decimals_buff[MAX_SUBSECOND_DECIMALS];
int subsecond_decimals_chars;
/*********************************************************************/
@@ -574,7 +574,9 @@ gboolean parse_line(gchar* linebuff, gint line_length, gint *seconds, gint *usec
}
/* Convert found value into microseconds */
- subsecond_decimals_buff[subsecond_decimals_chars] = '\0';
+ while (subsecond_decimals_chars < MAX_SUBSECOND_DECIMALS) {
+ subsecond_decimals_buff[subsecond_decimals_chars++] = '0';
+ }
/* Already know they are digits, so avoid expense of ws_strtoi32() */
*useconds = ((subsecond_decimals_buff[0] - '0') * 100000) +
((subsecond_decimals_buff[1] - '0') * 10000) +