Don't abort on big input
This commit is contained in:
@ -60,7 +60,8 @@ grow(long minsize)
|
|||||||
// make space for minsize + 1 (for termination) bytes
|
// make space for minsize + 1 (for termination) bytes
|
||||||
char* newbuffer;
|
char* newbuffer;
|
||||||
long newcap;
|
long newcap;
|
||||||
if (minsize > 10000)
|
#ifdef EXPLODE
|
||||||
|
if (minsize > 1000000)
|
||||||
{
|
{
|
||||||
// crude trap against infinite grow
|
// crude trap against infinite grow
|
||||||
error ("StreamBuffer exploded growing from %ld to %ld chars. Exiting\n",
|
error ("StreamBuffer exploded growing from %ld to %ld chars. Exiting\n",
|
||||||
@ -83,6 +84,7 @@ grow(long minsize)
|
|||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (minsize < cap)
|
if (minsize < cap)
|
||||||
{
|
{
|
||||||
// just move contents to start of buffer and clear end
|
// just move contents to start of buffer and clear end
|
||||||
|
Reference in New Issue
Block a user