summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Fuzzers
AgeCommit message (Collapse)Author
2022-02-08LibJS+Everywhere: Remove all VM::clear_exception() callsdavidot
Since VM::exception() no longer exists this is now useless. All of these calls to clear_exception were just to clear the VM state after some (potentially) failed evaluation and did not use the exception itself.
2022-01-22LibJS: Refactor interpreter to use Script and Source Text ModulesLuke Wilde
This also refactors interpreter creation to follow InitializeHostDefinedRealm, but I couldn't fit it in the title :^) This allows us to follow the spec much more closely rather than being completely ad-hoc with just the parse node instead of having all the surrounding data such as the realm of the parse node. The interpreter creation refactor creates the global execution context once and doesn't take it off the stack. This allows LibWeb to take the global execution context and manually handle it, following the HTML spec. The HTML spec calls this the "realm execution context" of the environment settings object. It also allows us to specify the globalThis type, as it can be different from the global object type. For example, on the web, Window global objects use a WindowProxy global this value to enforce the same origin policy on operations like [[GetOwnProperty]]. Finally, it allows us to directly call Program::execute in perform_eval and perform_shadow_realm_eval as this moves global_declaration_instantiation into Interpreter::run (ScriptEvaluation) as per the spec. Note that this doesn't evalulate Source Text Modules yet or refactor the bytecode interpreter, that's work for future us :^) This patch was originally build by Luke for the environment settings object change but was also needed for modules. So I (davidot) have modified it with the new completion changes and setup for that. Co-authored-by: davidot <davidot@serenityos.org>
2022-01-22LibAudio: Convert FlacLoader to use new Core::Stream APIs :^)kleines Filmröllchen
For this change to work "easily", Loader can't take const ByteBuffer's anymore, which is fine for now.
2022-01-08LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>Linus Groh
Instead of making it a void function, checking for an exception, and then receiving the relevant result via VM::last_value(), we can consolidate all of this by using completions. This allows us to remove more uses of VM::exception(), and all uses of VM::last_value().
2021-12-21Meta: Add a fuzzer for the QOILoaderLinus Groh
2021-12-05Fuzzers: Cast unused smart-pointer return values to voidSam Atkins
2021-11-28LibAudio: New error propagation API in Loader and Bufferkleines Filmröllchen
Previously, a libc-like out-of-line error information was used in the loader and its plugins. Now, all functions that may fail to do their job return some sort of Result. The universally-used error type ist the new LoaderError, which can contain information about the general error category (such as file format, I/O, unimplemented features), an error description, and location information, such as file index or sample index. Additionally, the loader plugins try to do as little work as possible in their constructors. Right after being constructed, a user should call initialize() and check the errors returned from there. (This is done transparently by Loader itself.) If a constructor caused an error, the call to initialize should check and return it immediately. This opportunity was used to rework a lot of the internal error propagation in both loader classes, especially FlacLoader. Therefore, a couple of other refactorings may have sneaked in as well. The adoption of LibAudio users is minimal. Piano's adoption is not important, as the code will receive major refactoring in the near future anyways. SoundPlayer's adoption is also less important, as changes to refactor it are in the works as well. aplay's adoption is the best and may serve as an example for other users. It also includes new buffering behavior. Buffer also gets some attention, making it OOM-safe and thereby also propagating its errors to the user.
2021-11-21LibGfx: Make ImageDecoderPlugin::frame() return ErrorOr<>Andreas Kling
This is a first step towards better error propagation from image codecs.
2021-11-18LibGfx: Remove ImageDecoderPlugin::bitmap() in favor of frame(index)Andreas Kling
To encourage proper support for multi-frame images throughout the system, get rid of the single-frame convenience bitmap() API.
2021-11-18Fuzzers: Use ImageDecoderPlugin::frame() in image decoder fuzzersAndreas Kling
Let's work towards getting rid of the first-frame-only bitmap() API.
2021-11-13Fuzzers: Use ImageDecoders instead of load_FORMAT_from_memory() wrappersAndreas Kling
2021-10-31FuzzilliJS: Convert native functions to ThrowCompletionOrIdan Horowitz
2021-10-30Lagom/Fuzzers: Add fuzzer for PDF documentBrendan Coles
2021-10-20LibJS: Rename define_native_function => define_old_native_functionIdan Horowitz
This method will eventually be removed once all native functions are converted to ThrowCompletionOr
2021-10-20LibJS: Add ThrowCompletionOr versions of the JS native function macrosIdan Horowitz
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all native functions were converted to the new format.
2021-10-18LibJS: Convert to_i32() to ThrowCompletionOrIdan Horowitz
2021-10-13LibJS: Convert to_string() to ThrowCompletionOrLinus Groh
Also update get_function_name() to use ThrowCompletionOr, but this is not a standard AO and should be refactored out of existence eventually.
2021-10-10Meta: Fix broken external linksBen Wiederhake
Meta/Lagom/ReadMe.md never had any other name; not sure how that typo happened. The link to the non-existent directory is especially vexing because the text goes on to explain that we don't want such a directory to exist. Found by running markdown-checker, and 'wget'ing all external links.
2021-09-18Lagom/Fuzzers: Add fuzzer for the LibCrypto PEM parserBrian Gianforcaro
2021-09-18Lagom/Fuzzers: Add fuzzer for the LibTLS ASN1 parserBrian Gianforcaro
2021-09-06Meta: Correct misuse of ByteBuffer::resize() as grow() in FuzziliJSAli Mohammad Pur
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-07-30Lagom: Fix oss-fuzz build error due to CMake typoBrian Gianforcaro
The OSS-Fuzz build was failing with the following error: /usr/bin/ld: cannot find -l{}
2021-07-29Lagom: Change to shared library build for all Lagom codeAndrew Kaster
Split the Lagom build into shared libraries to match the Serenity build. This reduces the cognitive load when trying to edit the Lagom CMakeLists significantly. It also reduces the amount of source files that must be compiled to run each test or host program significantly. Also re-organize all the build rules into sections. And reorganize the CMakeLists file in general.
2021-07-29LibTTF/LibGfx: Remove circular dependency by merging LibTTF into LibGfxAndrew Kaster
LibTTF has a concrete dependency on LibGfx for things like Gfx::Bitmap, and LibGfx has a concrete dependency in the TTF::Font class in Gfx::FontDatabase. This circular dependency works fine for Serenity and Lagom Linux builds of the two libraries. It also works fine for static library builds on Lagom macOS builds. However, future changes will make Lagom use shared libraries, and circular library dependencies are not tolerated in macOS.
2021-07-24Lagom/Fuzzers: Add fuzzer for the quoted printable decoderLuke
2021-07-13Lagom/Fuzzers: Add fuzzer for FLAC loaderLuke
2021-07-13Lagom/Fuzzers: Add fuzzer for POSIX basic regex parserLuke
2021-07-06LibJS: Remove the default length & attributes from define_native_*Idan Horowitz
These are usually incorrect, and people sometimes forget to add the correct values as a result of them being optional, so they should just be specified explicitly.
2021-07-06LibJS: Add define_direct_property and remove the define_property helperIdan Horowitz
This removes all usages of the non-standard define_property helper method and replaces all it's usages with the specification required alternative or with define_direct_property where appropriate.
2021-07-04LibTTF: Memory map TTF fonts instead of reading them into heap memoryAndreas Kling
All GUI applications currently load all TTF fonts on startup (to populate the Gfx::FontDatabase. This could probably be smarter.) Before this patch, everyone would open the files and read them into heap-allocated storage. Now we simply mmap() them instead. :^)
2021-07-04LibTTF: Make TTF::Font loading API return error stringsAndreas Kling
2021-06-24LibSQL: Move Lexer and Parser machinery to AST directoryJan de Visser
The SQL engine is expected to be a fairly sizeable piece of software. Therefore we're starting to restructure the codebase for growth.
2021-06-18Lagom/Fuzzers: Add fuzzers for all current hashing functionsLuke
Namely MD5, SHA1, SHA256, SHA384 and SHA512.
2021-06-11Meta: Fuzz the LibIMAP Parserx-yl
2021-06-06AK+Everywhere: Disallow constructing Functions from incompatible typesAli Mohammad Pur
Previously, AK::Function would accept _any_ callable type, and try to call it when called, first with the given set of arguments, then with zero arguments, and if all of those failed, it would simply not call the function and **return a value-constructed Out type**. This lead to many, many, many hard to debug situations when someone forgot a `const` in their lambda argument types, and many cases of people taking zero arguments in their lambdas to ignore them. This commit reworks the Function interface to not include any such surprising behaviour, if your function instance is not callable with the declared argument set of the Function, it can simply not be assigned to that Function instance, end of story.
2021-05-31Lagom/Fuzzers: Add SQL parser fuzzerLuke
2021-05-31AK: Replace ByteBuffer::grow with resize()/ensure_capacity()Gunnar Beutner
Previously ByteBuffer::grow() behaved like Vector<T>::resize(). However the function name was somewhat ambiguous - and so this patch updates ByteBuffer to behave more like Vector<T> by replacing grow() with resize() and adding an ensure_capacity() method. This also lets the user change the buffer's capacity without affecting the size which was not previously possible. Additionally this patch makes the capacity() method public (again).
2021-05-30Fuzz+LibGfx: When fuzzing GIFLoader, try to load all framesBen Wiederhake
2021-05-21Meta: Add a Wasm parser fuzzerAli Mohammad Pur
2021-05-16AK+Userland: Fix some compiler warnings and make variables const-refGunnar Beutner
This fixes a few compiler warnings and makes some variables const-ref in preparation for the next commit which changes how ByteBuffer works.
2021-05-07Meta: Fix Fuzzers CMakeLists.txt and ReadMe.md to use CXX_COMPILER_IDBrian Gianforcaro
Previously the directions omitted that you have to specify `-CMAKE_CXX_COMPILER` when building the Fuzzers. This would cause all kinds of weird problems at compilation and link time. You can't specify one or the other, they must both be pointing at clang in order for things to work as experted. Fix this by updating the documentation to specify that the user should specify both the C and CXX compiler explicitly to be safe, as well as forcing the cmake clang argument handling to modify the CXX compiler variable instead of the C version.
2021-05-01Lagom/Fuzzers: Add fuzzers for Windows-1251 and Windows-1255 decodersIdan Horowitz
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-11Everywhere: Update references from ReadMe.md => README.mdAndreas Kling
2021-03-27Lagom/Fuzzers: Add fuzzer for zip file parserLuke
2021-03-17LibJS: Rename GlobalObject::initialize() => initialize_global_object()Andreas Kling
This function was shadowing Object::initialize() which cannot be called on global objects and has a different set of parameters.
2021-03-14Lagom/Fuzzers: Add fuzzers for the new Gzip and Deflate compressorsLuke
2021-03-14Lagom/Fuzzers: Add fuzzers for Latin 1, Latin 2 and UTF16-BELuke
No fuzzer for UTF-8 as it (currently) just returns the input.
2021-03-12FuzzilliJs: Add missing <errno.h> includeAndreas Kling