PORTNAME= hiawatha
PORTVERSION= 7.4
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://www.hiawatha-webserver.org/files/ \
http://www.c-s.li/ports/
--- hiawatha.c.orig 2011-02-25 14:21:15.953502381 +0100
+++ hiawatha.c 2011-02-25 14:24:44.166094143 +0100
@@ -34,6 +34,7 @@
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/time.h>
+#include <limits.h>
#include "alternative.h"
#include "mimetype.h"
#include "serverconfig.h"
@@ -418,7 +419,7 @@
*strend = '\0';
content_length = str2int(strstart);
*strend = '\r';
- if (content_length < 0) {
+ if ((content_length < 0) || (INT_MAX - content_length - 2 <= header_length)) {
result = 400;
break;
}