mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 11:58:08 +00:00
Support filename pattern matching in whitelist
Allow the whitelist specified by AFL_LLVM_WHITELIST contain entries with UNIX shell-style wildcard pattern matching.
This commit is contained in:
@ -7,6 +7,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -155,9 +156,8 @@ bool isInWhitelist(llvm::Function *F) {
|
|||||||
* specified in the list. */
|
* specified in the list. */
|
||||||
if (instFilename.str().length() >= it->length()) {
|
if (instFilename.str().length() >= it->length()) {
|
||||||
|
|
||||||
if (instFilename.str().compare(
|
if (fnmatch((*it).c_str(),
|
||||||
instFilename.str().length() - it->length(), it->length(),
|
instFilename.str().c_str(), FNM_PATHNAME) == 0) {
|
||||||
*it) == 0) {
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user