Changeset 83426 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 25, 2020 7:40:09 PM (5 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r83124 r83426 2160 2160 common/checksum/crc32-zlib.cpp \ 2161 2161 common/fuzz/fuzz.cpp \ 2162 common/fuzz/fuzz-config.cpp \ 2162 2163 common/fuzz/fuzz-observer.cpp \ 2163 2164 common/fuzz/fuzz-target-recorder.cpp \ -
trunk/src/VBox/Runtime/common/fuzz/fuzz.cpp
r83291 r83426 1929 1929 1930 1930 1931 RTDECL(int) RTFuzzCtxCorpusInputAddFromVfsIoStrm(RTFUZZCTX hFuzzCtx, RTVFSIOSTREAM hVfsIos) 1932 { 1933 PRTFUZZCTXINT pThis = hFuzzCtx; 1934 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1935 AssertReturn(hVfsIos != NIL_RTVFSIOSTREAM, VERR_INVALID_HANDLE); 1936 1937 return RTFuzzCtxCorpusInputAddFromVfsIoStrmEx(hFuzzCtx, hVfsIos, pThis->offMutStart, pThis->cbMutRange); 1938 } 1939 1940 RTDECL(int) RTFuzzCtxCorpusInputAddFromVfsIoStrmEx(RTFUZZCTX hFuzzCtx, RTVFSIOSTREAM hVfsIos, 1941 uint64_t offMutStart, uint64_t cbMutRange) 1942 { 1943 PRTFUZZCTXINT pThis = hFuzzCtx; 1944 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 1945 AssertReturn(hVfsIos != NIL_RTVFSIOSTREAM, VERR_INVALID_HANDLE); 1946 1947 void *pvCorpus = NULL; 1948 RTFSOBJINFO ObjInfo; 1949 int rc = RTVfsIoStrmQueryInfo(hVfsIos, &ObjInfo, RTFSOBJATTRADD_UNIX); 1950 if (RT_SUCCESS(rc)) 1951 { 1952 PRTFUZZMUTATION pMutation = rtFuzzMutationCreateEx(pThis, 0, NULL, offMutStart, cbMutRange, 1953 ObjInfo.cbObject, &pvCorpus); 1954 if (RT_LIKELY(pMutation)) 1955 { 1956 pMutation->pMutator = &g_MutatorCorpus; 1957 pMutation->cbInput = ObjInfo.cbObject; 1958 pMutation->pvInput = pvCorpus; 1959 rc = RTVfsIoStrmRead(hVfsIos, pvCorpus, ObjInfo.cbObject, true /*fBlocking*/, NULL); 1960 if (RT_SUCCESS(rc)) 1961 rc = rtFuzzCtxMutationAdd(pThis, pMutation); 1962 1963 if (RT_FAILURE(rc)) 1964 rtFuzzMutationDestroy(pMutation); 1965 } 1966 else 1967 rc = VERR_NO_MEMORY; 1968 } 1969 1970 return rc; 1971 } 1972 1973 1931 1974 RTDECL(int) RTFuzzCtxCorpusInputAddFromDirPath(RTFUZZCTX hFuzzCtx, const char *pszDirPath) 1932 1975 {
Note:
See TracChangeset
for help on using the changeset viewer.