diff -burd varnish-3.0.4/bin/varnishd/cache_http.c varnish-3.0.4-statuscodes/bin/varnishd/cache_http.c
--- varnish-3.0.4/bin/varnishd/cache_http.c	2013-06-14 10:39:31.000000000 +0200
+++ varnish-3.0.4-statuscodes/bin/varnishd/cache_http.c	2013-10-11 17:49:53.990331638 +0200
@@ -100,7 +100,6 @@
 {
 	struct http_msg *mp;
 
-	assert(status >= 100 && status <= 999);
 	for (mp = http_msg; mp->nbr != 0 && mp->nbr <= status; mp++)
 		if (mp->nbr == status)
 			return (mp->txt);
@@ -712,7 +711,6 @@
 http_DissectResponse(struct worker *w, const struct http_conn *htc,
     struct http *hp)
 {
-	int j;
 	uint16_t retval = 0;
 	char *p;
 
@@ -732,23 +730,18 @@
 		retval = 503;
 
 	if (retval == 0) {
-		hp->status = 0;
 		p = hp->hd[HTTP_HDR_STATUS].b;
-		for (j = 100; j != 0; j /= 10) {
-			if (!vct_isdigit(*p)) {
-				retval = 503;
-				break;
-			}
-			hp->status += (uint16_t)(j * (*p - '0'));
-			p++;
-		}
-		if (*p != '\0')
+		if (p[0] >= '1' && p[0] <= '9' &&
+				p[1] >= '0' && p[1] <= '9' &&
+				p[2] >= '0' && p[2] <= '9')
+			hp->status =
+				100 * (p[0] - '0') + 10 * (p[1] - '0') + p[2] - '0';
+		else
 			retval = 503;
 	}
 
 	if (retval != 0) {
 		WSLR(w, SLT_HttpGarbage, htc->fd, htc->rxbuf);
-		assert(retval >= 100 && retval <= 999);
 		hp->status = retval;
 	} else {
 		http_ProtoVer(hp);
@@ -813,7 +806,6 @@
 
 	CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
 	http_SetH(to, HTTP_HDR_PROTO, proto);
-	assert(status >= 100 && status <= 999);
 	to->status = status;
 	http_SetH(to, HTTP_HDR_RESPONSE, response);
 }
@@ -1018,7 +1010,6 @@
 http_PutStatus(struct http *to, uint16_t status)
 {
 
-	assert(status >= 100 && status <= 999);
 	to->status = status;
 }
 
diff -burd varnish-3.0.4/bin/varnishd/cache_vrt_var.c varnish-3.0.4-statuscodes/bin/varnishd/cache_vrt_var.c
--- varnish-3.0.4/bin/varnishd/cache_vrt_var.c	2013-06-14 10:39:31.000000000 +0200
+++ varnish-3.0.4-statuscodes/bin/varnishd/cache_vrt_var.c	2013-10-11 17:50:47.616163686 +0200
@@ -101,7 +101,6 @@
 VRT_l_##obj##_status(const struct sess *sp, int num)		\
 {								\
 								\
-	assert(num >= 100 && num <= 999);			\
 	http->status = (uint16_t)num;				\
 }								\
 								\
diff -burd varnish-3.0.4/lib/libvarnish/cli_common.c varnish-3.0.4-statuscodes/lib/libvarnish/cli_common.c
--- varnish-3.0.4/lib/libvarnish/cli_common.c	2013-06-14 10:39:32.000000000 +0200
+++ varnish-3.0.4-statuscodes/lib/libvarnish/cli_common.c	2013-10-11 17:52:17.761884006 +0200
@@ -93,9 +93,6 @@
 					 * any misformats by snprintf
 					 */
 
-	assert(status >= 100);
-	assert(status <= 999);		/*lint !e650 const out of range */
-
 	i = snprintf(res, sizeof res,
 	    "%-3d %-8jd\n", status, (intmax_t)strlen(result));
 	assert(i == CLI_LINE0_LEN);
diff --git a/bin/varnishtest/tests/r01337.vtc b/bin/varnishtest/tests/r01337.vtc
new file mode 100644
index 0000000..d954347
--- /dev/null
+++ b/bin/varnishtest/tests/r01337.vtc
@@ -0,0 +1,22 @@
+varnishtest "Bogus backend status"
+
+server s1 {
+       rxreq
+       expect req.url == /low
+       txresp -status 099
+       accept
+       rxreq
+       expect req.url == /high
+       txresp -status 1000
+} -start
+
+varnish v1 -vcl+backend {} -start
+
+client c1 {
+       txreq -url /low
+       rxresp
+       expect resp.status == 503
+       txreq -url /high
+       rxresp
+       expect resp.status == 503
+} -run


