We don't need this anymore.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
We don't need this anymore.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | contrib/fuzz/Makefile (25 lines) | |||
M | contrib/fuzz/bdiff.cc (8 lines) | |||
M | contrib/fuzz/mpatch.cc (13 lines) | |||
M | contrib/fuzz/xdiff.cc (8 lines) |
standalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cc | standalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cc | ||||
pyutil.o: pyutil.cc pyutil.h | pyutil.o: pyutil.cc pyutil.h | ||||
$(CXX) $(CXXFLAGS) -g -O1 \ | $(CXX) $(CXXFLAGS) -g -O1 \ | ||||
`$(PYTHON_CONFIG) --cflags` \ | `$(PYTHON_CONFIG) --cflags` \ | ||||
-I../../mercurial -c -o pyutil.o pyutil.cc | -I../../mercurial -c -o pyutil.o pyutil.cc | ||||
bdiff.o: ../../mercurial/bdiff.c | |||||
$(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ | |||||
../../mercurial/bdiff.c | |||||
bdiff: bdiff.cc bdiff.o | |||||
$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | |||||
-std=c++17 \ | |||||
-I../../mercurial bdiff.cc bdiff.o -o bdiff | |||||
bdiff-oss-fuzz.o: ../../mercurial/bdiff.c | bdiff-oss-fuzz.o: ../../mercurial/bdiff.c | ||||
$(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c | $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c | ||||
bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o | bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o | ||||
$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ | ||||
bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ | bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ | ||||
$$OUT/bdiff_fuzzer | $$OUT/bdiff_fuzzer | ||||
mpatch.o: ../../mercurial/mpatch.c | mpatch.o: ../../mercurial/mpatch.c | ||||
$(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \ | $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \ | ||||
../../mercurial/mpatch.c | ../../mercurial/mpatch.c | ||||
mpatch: CXXFLAGS += -std=c++17 | |||||
mpatch: mpatch.cc mpatch.o | |||||
$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | |||||
-I../../mercurial mpatch.cc mpatch.o -o mpatch | |||||
mpatch-oss-fuzz.o: ../../mercurial/mpatch.c | mpatch-oss-fuzz.o: ../../mercurial/mpatch.c | ||||
$(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c | $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c | ||||
mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o | mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o | ||||
$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ | ||||
mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ | mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ | ||||
$$OUT/mpatch_fuzzer | $$OUT/mpatch_fuzzer | ||||
mpatch_corpus.zip: | mpatch_corpus.zip: | ||||
python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip | python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip | ||||
x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | |||||
$(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \ | |||||
-o $@ \ | |||||
$< | |||||
xdiff: CXXFLAGS += -std=c++17 | |||||
xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o | |||||
$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ | |||||
-I../../mercurial xdiff.cc \ | |||||
xdiffi.o xprepare.o xutils.o -o xdiff | |||||
fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h | ||||
$(CC) $(CFLAGS) -c \ | $(CC) $(CFLAGS) -c \ | ||||
-o $@ \ | -o $@ \ | ||||
$< | $< | ||||
xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o | xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o | ||||
$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ | $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ | ||||
fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \ | fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \ |
struct bdiff_hunk l; | struct bdiff_hunk l; | ||||
bdiff_diff(a, an, b, bn, &l); | bdiff_diff(a, an, b, bn, &l); | ||||
free(a); | free(a); | ||||
free(b); | free(b); | ||||
bdiff_freehunks(l.next); | bdiff_freehunks(l.next); | ||||
return 0; // Non-zero return values are reserved for future use. | return 0; // Non-zero return values are reserved for future use. | ||||
} | } | ||||
#ifdef HG_FUZZER_INCLUDE_MAIN | |||||
int main(int argc, char **argv) | |||||
{ | |||||
const char data[] = "asdf"; | |||||
return LLVMFuzzerTestOneInput((const uint8_t *)data, 4); | |||||
} | |||||
#endif | |||||
} // extern "C" | } // extern "C" |
free(dest); | free(dest); | ||||
LOG(1) << "applied a complete patch" << std::endl; | LOG(1) << "applied a complete patch" << std::endl; | ||||
} | } | ||||
cleanup: | cleanup: | ||||
mpatch_lfree(patch); | mpatch_lfree(patch); | ||||
return 0; | return 0; | ||||
} | } | ||||
#ifdef HG_FUZZER_INCLUDE_MAIN | |||||
int main(int argc, char **argv) | |||||
{ | |||||
// One text, one patch. | |||||
const char data[] = "\x02\x00\0x1\x00\x0d" | |||||
// base text | |||||
"a" | |||||
// binary delta that will append a single b | |||||
"\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01b"; | |||||
return LLVMFuzzerTestOneInput((const uint8_t *)data, 19); | |||||
} | |||||
#endif | |||||
} // extern "C" | } // extern "C" |
}; | }; | ||||
xdemitcb_t ecb = { | xdemitcb_t ecb = { | ||||
NULL, /* priv */ | NULL, /* priv */ | ||||
}; | }; | ||||
xdl_diff(&a, &b, &xpp, &xecfg, &ecb); | xdl_diff(&a, &b, &xpp, &xecfg, &ecb); | ||||
return 0; // Non-zero return values are reserved for future use. | return 0; // Non-zero return values are reserved for future use. | ||||
} | } | ||||
#ifdef HG_FUZZER_INCLUDE_MAIN | |||||
int main(int argc, char **argv) | |||||
{ | |||||
const char data[] = "asdf"; | |||||
return LLVMFuzzerTestOneInput((const uint8_t *)data, 4); | |||||
} | |||||
#endif | |||||
} // extern "C" | } // extern "C" |