pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

honggfuzz: import honggfuzz-1.6



Module Name:	pkgsrc-wip
Committed By:	tomsun.0.7 <tomsun.0.7%gmail.com@localhost>
Pushed By:	tomsun.0.7
Date:		Fri Jun 29 13:42:20 2018 +0000
Changeset:	3be8aebfaf39a8e6ae330194a97ba2493db4cb77

Added Files:
	honggfuzz/DESCR
	honggfuzz/Makefile
	honggfuzz/PLIST
	honggfuzz/distinfo
	honggfuzz/patches/patch-Makefile
	honggfuzz/patches/patch-libhfcommon_util.c
	honggfuzz/patches/patch-libhfuzz_memorycmp.c

Log Message:
honggfuzz: import honggfuzz-1.6

A security oriented, feedback-driven, evolutionary, easy-to-use fuzzer
with interesting analysis options.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3be8aebfaf39a8e6ae330194a97ba2493db4cb77

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 honggfuzz/DESCR                              |  2 ++
 honggfuzz/Makefile                           | 15 ++++++++++++
 honggfuzz/PLIST                              |  7 ++++++
 honggfuzz/distinfo                           |  9 +++++++
 honggfuzz/patches/patch-Makefile             | 32 +++++++++++++++++++++++++
 honggfuzz/patches/patch-libhfcommon_util.c   | 21 +++++++++++++++++
 honggfuzz/patches/patch-libhfuzz_memorycmp.c | 35 ++++++++++++++++++++++++++++
 7 files changed, 121 insertions(+)

diffs:
diff --git a/honggfuzz/DESCR b/honggfuzz/DESCR
new file mode 100644
index 0000000000..a1e817dcde
--- /dev/null
+++ b/honggfuzz/DESCR
@@ -0,0 +1,2 @@
+A security oriented, feedback-driven, evolutionary, easy-to-use fuzzer
+with interesting analysis options.
diff --git a/honggfuzz/Makefile b/honggfuzz/Makefile
new file mode 100644
index 0000000000..493d522b04
--- /dev/null
+++ b/honggfuzz/Makefile
@@ -0,0 +1,15 @@
+# $NetBSD$
+
+DISTNAME=	honggfuzz-1.6
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=google/}
+
+MAINTAINER=	tomsun.0.7%gmail.com@localhost
+HOMEPAGE=	https://github.com/google/honggfuzz/
+COMMENT=	Security oriented fuzzer based on code coverage
+LICENSE=	apache-2.0
+
+USE_TOOLS+=	bash:run gmake
+
+.include "../../lang/libBlocksRuntime/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/honggfuzz/PLIST b/honggfuzz/PLIST
new file mode 100644
index 0000000000..4496955945
--- /dev/null
+++ b/honggfuzz/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD$
+bin/hfuzz-cc
+bin/hfuzz-clang
+bin/hfuzz-clang++
+bin/hfuzz-g++
+bin/hfuzz-gcc
+bin/honggfuzz
diff --git a/honggfuzz/distinfo b/honggfuzz/distinfo
new file mode 100644
index 0000000000..15f3b6bac9
--- /dev/null
+++ b/honggfuzz/distinfo
@@ -0,0 +1,9 @@
+$NetBSD$
+
+SHA1 (honggfuzz-1.6.tar.gz) = e6ab2a411fe8726e57815209d6fb1b6f4268538c
+RMD160 (honggfuzz-1.6.tar.gz) = 8ef15a0e38cd09a26f82a3683da6a363257ddce1
+SHA512 (honggfuzz-1.6.tar.gz) = db4f0f31d36080db983068435be82b3e1132145e0bad5c4e8e6504563f10ce66df4f977fbd0a9f1cbcd262e479f635a68ab7c1df70d23e8437164734ea562c90
+Size (honggfuzz-1.6.tar.gz) = 79322453 bytes
+SHA1 (patch-Makefile) = 3c0242922d4e457637072ef93cd1a7cb5cf8973f
+SHA1 (patch-libhfcommon_util.c) = 9f00448a2cfc3436c87a2b2a33dcd92de6afc49b
+SHA1 (patch-libhfuzz_memorycmp.c) = fed71b1e414f54788cabec18f4cd7fda40585123
diff --git a/honggfuzz/patches/patch-Makefile b/honggfuzz/patches/patch-Makefile
new file mode 100644
index 0000000000..30d753f765
--- /dev/null
+++ b/honggfuzz/patches/patch-Makefile
@@ -0,0 +1,32 @@
+$NetBSD$
+
+1. Replace -lpthread with -pthread
+2. Add install option
+
+--- Makefile.orig	2018-04-19 13:37:38.000000000 +0000
++++ Makefile
+@@ -145,7 +145,7 @@ else
+                    -Wextra -Wno-initializer-overrides -Wno-override-init \
+                    -Wno-unknown-warning-option -Wno-unknown-pragmas \
+                    -funroll-loops
+-    ARCH_LDFLAGS := -lpthread -L/usr/local/lib
++    ARCH_LDFLAGS := -pthread -L/usr/local/lib
+     # OS Posix
+ endif
+ 
+@@ -440,3 +440,15 @@ mac/arch.o: sancov.h subproc.h
+ posix/arch.o: arch.h honggfuzz.h libhfcommon/util.h fuzz.h
+ posix/arch.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
+ posix/arch.o: libhfcommon/log.h sancov.h subproc.h
++
++PREFIX		?= /usr/local
++BIN_PATH	=$(PREFIX)/bin
++
++install: all
++	mkdir -p -m 755 $${DESTDIR}$(BIN_PATH)
++	install -m 755 honggfuzz $${DESTDIR}$(BIN_PATH)
++	install -m 755 hfuzz_cc/hfuzz-cc $${DESTDIR}$(BIN_PATH)
++	install -m 755 hfuzz_cc/hfuzz-clang $${DESTDIR}$(BIN_PATH)
++	install -m 755 hfuzz_cc/hfuzz-clang++ $${DESTDIR}$(BIN_PATH)
++	install -m 755 hfuzz_cc/hfuzz-gcc $${DESTDIR}$(BIN_PATH)
++	install -m 755 hfuzz_cc/hfuzz-g++ $${DESTDIR}$(BIN_PATH)
diff --git a/honggfuzz/patches/patch-libhfcommon_util.c b/honggfuzz/patches/patch-libhfcommon_util.c
new file mode 100644
index 0000000000..56b9073bf5
--- /dev/null
+++ b/honggfuzz/patches/patch-libhfcommon_util.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Convert char type to unsigned char type for isdigit(3) to avoid
+char-subscript error on NetBSD
+
+--- libhfcommon/util.c.orig	2018-04-19 13:37:38.000000000 +0000
++++ libhfcommon/util.c
+@@ -284,11 +284,11 @@ int64_t fastArray64Search(uint64_t* arra
+ }
+ 
+ bool util_isANumber(const char* s) {
+-    if (!isdigit(s[0])) {
++    if (!isdigit((unsigned char)s[0])) {
+         return false;
+     }
+     for (int i = 0; s[i]; s++) {
+-        if (!isdigit(s[i]) && s[i] != 'x') {
++        if (!isdigit((unsigned char)s[i]) && s[i] != 'x') {
+             return false;
+         }
+     }
diff --git a/honggfuzz/patches/patch-libhfuzz_memorycmp.c b/honggfuzz/patches/patch-libhfuzz_memorycmp.c
new file mode 100644
index 0000000000..13cc9e5599
--- /dev/null
+++ b/honggfuzz/patches/patch-libhfuzz_memorycmp.c
@@ -0,0 +1,35 @@
+$NetBSD$
+
+Convert char type to unsigned char type for tolower(3) to avoid
+char-subscript error on NetBSD
+
+--- libhfuzz/memorycmp.c.orig	2018-04-19 13:37:38.000000000 +0000
++++ libhfuzz/memorycmp.c
+@@ -44,14 +44,14 @@ static inline int _strcasecmp(const char
+     unsigned int v = 0;
+ 
+     size_t i;
+-    for (i = 0; tolower(s1[i]) == tolower(s2[i]); i++) {
++    for (i = 0; tolower((unsigned char)s1[i]) == tolower((unsigned char)s2[i]); i++) {
+         if (s1[i] == '\0' || s2[i] == '\0') {
+             break;
+         }
+         v++;
+     }
+     instrumentUpdateCmpMap(addr, v);
+-    return (tolower(s1[i]) - tolower(s2[i]));
++    return (tolower((unsigned char)s1[i]) - tolower((unsigned char)s2[i]));
+ }
+ 
+ static inline int _strncmp(const char* s1, const char* s2, size_t n, uintptr_t addr) {
+@@ -86,8 +86,8 @@ static inline int _strncasecmp(const cha
+     int ret = 0;
+ 
+     for (size_t i = 0; i < n; i++) {
+-        if (tolower(s1[i]) != tolower(s2[i])) {
+-            ret = ret ? ret : (tolower(s1[i]) - tolower(s2[i]));
++        if (tolower((unsigned char)s1[i]) != tolower((unsigned char)s2[i])) {
++            ret = ret ? ret : (tolower((unsigned char)s1[i]) - tolower((unsigned char)s2[i]));
+         } else {
+             v++;
+         }


Home | Main Index | Thread Index | Old Index