autobuf: let's limit the maximum size to 16MB
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 24 Jun 2016 07:39:12 +0000 (09:39 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 24 Jun 2016 07:39:57 +0000 (09:39 +0200)
TO avoid thrashing the system when an autobuf is abused.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/common/autobuf.h

index 01f69da..cab6425 100644 (file)
@@ -55,7 +55,7 @@ struct autobuf;
 
 #define AUTOBUFCHUNK   4096
 
-#define AUTOBUFSIZEMAX INT_MAX
+#define AUTOBUFSIZEMAX (1 << 24)
 
 struct autobuf {
     int size;