dovecot-2.2: json-parser: Fixed infinite looping in some situati...

dovecot at dovecot.org dovecot at dovecot.org
Wed Dec 19 14:41:11 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/a1b814081f0c
changeset: 15491:a1b814081f0c
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Dec 19 14:41:01 2012 +0200
description:
json-parser: Fixed infinite looping in some situations.

diffstat:

 src/lib/json-parser.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 0c9a4af8eaf8 -r a1b814081f0c src/lib/json-parser.c
--- a/src/lib/json-parser.c	Wed Dec 19 14:39:55 2012 +0200
+++ b/src/lib/json-parser.c	Wed Dec 19 14:41:01 2012 +0200
@@ -546,7 +546,8 @@
 		/* parsing probably failed because there wasn't enough input.
 		   reset the error and try reading more. */
 		parser->error = NULL;
-
+		parser->highwater_offset = parser->input->v_offset +
+			i_stream_get_data_size(parser->input);
 	}
 	return ret;
 }
@@ -623,6 +624,8 @@
 		/* parsing probably failed because there wasn't enough input.
 		   reset the error and try reading more. */
 		parser->error = NULL;
+		parser->highwater_offset = parser->input->v_offset +
+			i_stream_get_data_size(parser->input);
 	}
 	return ret;
 }


More information about the dovecot-cvs mailing list