Fix stb image on windows (#1657)

* fix

* fix

* HOW DO I ADD FROM:FROM????

* ok
This commit is contained in:
Dongjia "toka" Zhang 2023-11-08 15:20:35 +01:00 committed by GitHub
parent c97d0fa7fc
commit d53503b73e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 19 additions and 4 deletions

View File

@ -365,6 +365,8 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- name: install cxx bridge
run: cargo install cxxbridge-cmd
- name: Build fuzzers/libfuzzer_stb_image
run: cd fuzzers/libfuzzer_stb_image && cargo build --release
- name: Build fuzzers/frida_libpng
run: cd fuzzers/frida_libpng/ && cargo make test
- name: Build fuzzers/frida_gdiplus

View File

@ -18,7 +18,7 @@ debug = true
[dependencies]
libafl = { path = "../../libafl/" }
libafl_bolts = { path = "../../libafl_bolts/" }
libafl_targets = { path = "../../libafl_targets/", features = ["sancov_pcguard_edges", "sancov_cmplog", "libfuzzer"] }
libafl_targets = { path = "../../libafl_targets/", features = ["sancov_pcguard_edges", "sancov_cmplog", "libfuzzer", "libfuzzer_no_link_main"] }
mimalloc = { version = "*", default-features = false }
[build-dependencies]

View File

@ -251,6 +251,7 @@ where
/// ``CachedOnDiskCorpus`` Python bindings
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
pub mod pybind {
use alloc::string::String;
use std::path::PathBuf;

View File

@ -429,6 +429,7 @@ where
/// `InMemoryCorpus` Python bindings
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
pub mod pybind {
use pyo3::prelude::*;
use serde::{Deserialize, Serialize};

View File

@ -439,6 +439,7 @@ where
}
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
/// `InMemoryOnDiskCorpus` Python bindings
pub mod pybind {
use alloc::string::String;

View File

@ -262,6 +262,7 @@ where
}
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
/// `OnDiskCorpus` Python bindings
pub mod pybind {
use alloc::string::String;

View File

@ -579,6 +579,7 @@ where
/// `SimpleEventManager` Python bindings
#[cfg(feature = "python")]
#[allow(missing_docs)]
#[allow(clippy::unnecessary_fallible_conversions)]
pub mod pybind {
use pyo3::prelude::*;

View File

@ -2214,6 +2214,7 @@ mod tests {
#[cfg(feature = "python")]
#[allow(missing_docs)]
#[allow(clippy::unnecessary_fallible_conversions)]
/// `InProcess` Python bindings
pub mod pybind {
use alloc::boxed::Box;

View File

@ -1095,6 +1095,7 @@ impl From<bool> for ConstFeedback {
/// `Feedback` Python bindings
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
#[allow(missing_docs)]
pub mod pybind {
use std::cell::UnsafeCell;

View File

@ -170,6 +170,7 @@ where
/// `Generator` Python bindings
#[allow(missing_docs)]
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
pub mod pybind {
use alloc::vec::Vec;

View File

@ -847,10 +847,10 @@ impl ClientPerfMonitor {
/// Update the given [`PerfFeature`] with the given `time`
pub fn update_feature(&mut self, feature: PerfFeature, time: u64) {
// Get the current stage index as `usize`
let stage_index: usize = self.curr_stage.try_into().unwrap();
let stage_index: usize = self.curr_stage.into();
// Get the index of the given feature
let feature_index: usize = feature.try_into().unwrap();
let feature_index: usize = feature.into();
if stage_index >= self.stages.len() {
self.stages
@ -984,6 +984,7 @@ impl Default for ClientPerfMonitor {
}
/// `Monitor` Python bindings
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
#[allow(missing_docs)]
pub mod pybind {
use alloc::{boxed::Box, string::String, vec::Vec};

View File

@ -603,6 +603,7 @@ mod tests {
/// `SchedulerMutator` Python bindings
#[cfg(feature = "python")]
#[allow(missing_docs)]
#[allow(clippy::unnecessary_fallible_conversions)]
pub mod pybind {
use pyo3::prelude::*;

View File

@ -1331,6 +1331,7 @@ where
slice::from_raw_parts_mut(map.as_mut_ptr().add(align_offset) as *mut u16, cnt)
};
// 2022-07: Adding `enumerate` here increases execution speed/register allocation on x86_64.
#[allow(clippy::unused_enumerate_index)]
for (_i, item) in map16[0..cnt].iter_mut().enumerate() {
unsafe {
*item = *COUNT_CLASS_LOOKUP_16.get_unchecked(*item as usize);

View File

@ -365,6 +365,7 @@ where
#[cfg(feature = "python")]
#[allow(missing_docs)]
#[allow(clippy::unnecessary_fallible_conversions)]
/// `StdMutationalStage` Python bindings
pub mod pybind {
use pyo3::prelude::*;

View File

@ -556,7 +556,7 @@ where
return Err(Error::illegal_state("Received empty ShMemId from unix shmem client. Are the shmem limits set correctly? Did a client crash?"));
}
let description_id: i32 = description.id.try_into().unwrap();
let description_id: i32 = description.id.into();
if !self.all_shmems.contains_key(&description_id) {
// We should never get here, but it may happen if the OS ran out of shmem pages at some point//reached limits.

View File

@ -435,6 +435,7 @@ mod tests {
}
#[cfg(feature = "python")]
#[allow(clippy::unnecessary_fallible_conversions)]
#[allow(missing_docs)]
/// `Rand` Python bindings
pub mod pybind {