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>
This commit is contained in:
Dario Lombardo 2019-12-21 18:24:58 +01:00 committed by Guy Harris
parent a8331a9274
commit 1c98b5b180
1 changed files with 2 additions and 2 deletions

View File

@ -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];
}