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 <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
@ -155,9 +156,8 @@ bool isInWhitelist(llvm::Function *F) {
|
||||
* specified in the list. */
|
||||
if (instFilename.str().length() >= it->length()) {
|
||||
|
||||
if (instFilename.str().compare(
|
||||
instFilename.str().length() - it->length(), it->length(),
|
||||
*it) == 0) {
|
||||
if (fnmatch((*it).c_str(),
|
||||
instFilename.str().c_str(), FNM_PATHNAME) == 0) {
|
||||
|
||||
return true;
|
||||
|
||||
|
Reference in New Issue
Block a user