aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/log3gpp.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2019-12-21 18:24:58 +0100
committerGuy Harris <guy@alum.mit.edu>2019-12-21 18:57:23 +0000
commit1c98b5b1800416460014b4dd6cdd4bba2d9c5a52 (patch)
tree22bf7c41cb5c69d32916886fd0906182717d8b19 /wiretap/log3gpp.c
parenta8331a9274bbd8161a2fd0f0b98ce39b1aa4cae2 (diff)
log3gpp: invert check with use of offset.
n is used to address the buffers, but the check condition follows its use. Fix the code by inverting the two of them Bug: 16283 Change-Id: I7cba868979982946f99cfe787a7b5f86d2db1b70 Reviewed-on: https://code.wireshark.org/review/35538 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/log3gpp.c')
-rw-r--r--wiretap/log3gpp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/log3gpp.c b/wiretap/log3gpp.c
index 04ff73dc64..3593ec917a 100644
--- a/wiretap/log3gpp.c
+++ b/wiretap/log3gpp.c
@@ -704,7 +704,7 @@ gboolean parse_line(gchar* linebuff, gint line_length, gint *seconds, gint *usec
n++;
/* Now skip ahead to find start of data (marked by '$') */
- for (; (linebuff[n] != '$') && (n <= line_length) && (prot_option_chars <= MAX_PROTOCOL_PAR_STRING);
+ for (; (n <= line_length) && (linebuff[n] != '$') && (prot_option_chars <= MAX_PROTOCOL_PAR_STRING);
n++,prot_option_chars++)
{
protocol_parameters[prot_option_chars] = linebuff[n];
@@ -820,7 +820,7 @@ gboolean get_file_time_stamp(gchar* linebuff, time_t *secs, guint32 *usecs)
/**************************************************************/
/* First is month. Read until get a space following the month */
- for (n=0; (linebuff[n] != ' ') && (n < MAX_MONTH_LETTERS); n++)
+ for (n=0; (n < MAX_MONTH_LETTERS) && (linebuff[n] != ' '); n++)
{
month[n] = linebuff[n];
}