[master] 282df44 Polish

Federico G. Schwindt fgsch at lodoss.net
Mon Apr 23 17:48:17 UTC 2018


commit 282df4408258dc30c4d85b14ee380fbc16f029ef
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Apr 23 11:10:45 2018 +0100

    Polish

diff --git a/bin/varnishd/fuzzers/esi_parse_fuzzer.c b/bin/varnishd/fuzzers/esi_parse_fuzzer.c
index 049d98a..c09c888 100644
--- a/bin/varnishd/fuzzers/esi_parse_fuzzer.c
+++ b/bin/varnishd/fuzzers/esi_parse_fuzzer.c
@@ -55,14 +55,6 @@ VSLb(struct vsl_log *vsl, enum VSL_tag_e tag, const char *fmt, ...)
 	(void)fmt;
 }
 
-
-void *
-WS_Alloc(struct ws *ws, unsigned bytes)
-{
-	(void)ws;
-	return (calloc(1, bytes));
-}
-
 void
 VSLb_ts(struct vsl_log *l, const char *event, double first, double *pprev,
     double now)
@@ -74,6 +66,13 @@ VSLb_ts(struct vsl_log *l, const char *event, double first, double *pprev,
 	(void)now;
 }
 
+void *
+WS_Alloc(struct ws *ws, unsigned bytes)
+{
+	(void)ws;
+	return (calloc(1, bytes));
+}
+
 int
 LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 {
@@ -90,6 +89,8 @@ LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 	if (size < 1)
 		return (0);
 
+	AN(data);
+
 	VSC_C_main = &__VSC_C_main;
 	cache_param = &__cache_param;
 
@@ -124,8 +125,8 @@ main(int argc, char **argv)
 	int i;
 
 	for (i = 1; i < argc; i++) {
+		len = 0;
 		buf = VFIL_readfile(NULL, argv[i], &len);
-		AN(buf);
 		LLVMFuzzerTestOneInput((uint8_t *)buf, len);
 		free(buf);
 	}


More information about the varnish-commit mailing list