# HG changeset patch # User mru # Date 1268775930 0 # Node ID 3dc78fb78b2ab555f72831f45ddce7513039a3d8 # Parent cf00e196666a1f34e0a6b2b392922fc70cc680a6 Fix erroneous behaviour when format probe hits end of file If the format probe hits end of file, do not add the error code to the buffer position. This is obviously wrong, and with a small input file would cause a negative buffer overflow. Fixes issue 1818. diff -r cf00e196666a -r 3dc78fb78b2a utils.c --- a/utils.c Mon Mar 15 23:15:24 2010 +0000 +++ b/utils.c Tue Mar 16 21:45:30 2010 +0000 @@ -495,6 +495,7 @@ return ret; } score = 0; + ret = 0; /* error was end of file, nothing read */ } pd.buf_size += ret; pd.buf = &buf[offset];