Commit graph

51972 commits

Author SHA1 Message Date
Shannon Booth dc27d19b21 AK: Remove superfluous check for file state in URL basic parse
The spec does not mention any of the other checks we were doing.
2023-07-05 11:41:10 +02:00
Shannon Booth b76972ff32 AK: Correct faulty logic in file slash state in basic URL parsing
We were not correctly decrementing the pointer in the case that either
the base URL was non-null or the base URL's scheme was not a file.
2023-07-05 11:41:10 +02:00
Shannon Booth a809d1634f AK: Add missing spec assert in relative state basic URL parsing 2023-07-05 11:41:10 +02:00
Shannon Booth 4dd4ff68d3 AK: Correct logic in file state decrementing a path in URL basic parsing 2023-07-05 11:41:10 +02:00
Shannon Booth 983441b67f AK: Check for state override in more places for basic URL parsing 2023-07-05 11:41:10 +02:00
Shannon Booth c6c424e982 AK: Add spec comments for 'basic URL parser'
By golly, this is a lot more spec comments than I originally thought
I would need to do! This has exposed some bugs in the implementation,
as well as a whole lot of things which we are yet to implement.

No functional changes intended in this commit (already pretty large
as is!).
2023-07-05 11:41:10 +02:00
Karol Kosek bd853de716 Mail: Fix crash caused by migration from NonnullRefPtrVector
When we moved from NonnullRefPtrVector<T> to Vector<NonnullRefPtr<T>>
in commit 8a48246ed1, the `at()` function
started returning a NonnullRefPtr<T>& instead of T&.

The code calling create_index() was not then updated and ended up taking
a pointer to a temporary NonnullRefPtr<>, instead of an actual object,
leading to a crash after logging in.
2023-07-05 11:39:27 +02:00
Shannon Booth dfcd5ffaba Base: Update diff(1) man page to latest set of options
Describe how to use the two new context and unified format options in
the diff utility. Also change the example comparison of two files so
they contain more lines as that is much more interesting (and useful).
2023-07-05 10:26:48 +01:00
Shannon Booth c57658fffa diff: Allow configurable context for unified and context diffs
Add the options '-C','--context' and '-U','--unified', which can be used
to ask diff to write a diff in that format with a given number of
context lines surrounding the diff.
2023-07-05 10:26:48 +01:00
Nicolas Ramz 876ad69ea3 LibWeb: Support bgcolor attribute on tr elements 2023-07-05 08:19:55 +01:00
Daniel Bertalan bd93b4984b Kernel/aarch64: Use unsigned values in the register bitfields
This resolves the various "implicit truncation from int to a one-bit
wide bit-field changes value from 1 to -1" warnings produced by Clang
16+ when assigning to single-bit bitfields.
2023-07-05 08:17:51 +01:00
Carwyn Nelson 093cbcd606 LibManual: Error on section_number 0 instead of crashing
Prior to this commit if you tried to access section 0 of the man page
(`man 0 ls`) the application would just crash with an array out of
bounds style error.

This commit just ensures that we return an explicit and helpful error
message when you try to request the 0th section, instead of crashing.
2023-07-05 08:57:39 +02:00
Daniel 0eb09a0b59 BrickGame: Propagate errors 2023-07-05 08:48:10 +02:00
Liav A 83ebd1882f Utilities: Add the memstat utility
This small utility is something we probably needed for a very long
time - a way to print memory statistics in an elegant manner.

This utility opens /sys/kernel/memstat, reads it and decode the values
into human readable entries, possibly even into human-readable sizes.
2023-07-05 08:34:51 +02:00
Liav A b74cb569ec Utilities/allocate: Modernize the code a bit
Use LibCore ArgsParser to parse the parameters instead of using the raw
strings from the argv (Main::Arguments) array.

Also, use indicative names for variables in the code so the utility code
is more understandable.
2023-07-05 08:34:51 +02:00
Aliaksandr Kalenik 75ae368896 LibJS: Propagate "contains await" flag to parent scope in ScopePusher
The flag indicating the presence of an await expression should be
passed up to the parent scope until the nearest function scope is
reached. This resolves several problems related to identifying
top-level awaits, which are currently not recognized correctly
when used within a nested scope.
2023-07-05 06:05:22 +02:00
Ben Wiederhake a627c15b07 Ports: Avoid using DeprecatedFile in OpenJDK 2023-07-04 15:48:44 -06:00
Linus Groh 63c7747b8d Ports/SuperTuxKart: Set app icon 2023-07-04 21:08:55 +01:00
Nico Weber 5619bb3e04 LibAudio: Stop using and remove LOADER_TRY
It's no longer needed now that this code uses ErrorOr instead of Result.

Ran:

    rg -lw LOADER_TRY Userland/Libraries/LibAudio \
        | xargs sed -i '' 's/LOADER_TRY/TRY/g'

...and then manually fixed up Userland/Libraries/LibAudio/LoaderError.h
to not redefine TRY but instead remove the now-unused LOADER_TRY,
and ran clang-format.
2023-07-04 13:24:17 -06:00
Linus Groh 9594b79d38 Ports/SuperTuxKart: Use 'NOT SERENITYOS' to disable USE_IPV6 option 2023-07-04 19:38:24 +01:00
Linus Groh 5c75117262 Ports/SuperTuxKart: Clean up IrrCompileConfig.h patch a little
There was still some code commented out from earlier attempts
piggybacking on Haiku ifdefs, this should now be in an upstreamable
state.
2023-07-04 19:38:24 +01:00
Linus Groh fc6cf76b05 Ports/SuperTuxKart: Enable now-implemented SDL_GetWindowWMInfo() call 2023-07-04 19:38:24 +01:00
Linus Groh 8dee35065b Ports/SDL2: Implement GetWindowWMInfo 2023-07-04 19:38:24 +01:00
Jelle Raaijmakers eacc0bfa02 AK+LibC: Remove AK/Atomic.h includes from our RefPtrs
We don't seem to be using it there.
2023-07-04 16:30:13 +02:00
Andreas Kling 6b3b056476 LibWeb: Support CSS font shorthand with up to 4 consecutive normal
All of the following properties in the font shorthand can be `normal`:

- font-style
- font-variant
- font-weight
- font-stretch

This means that we must allow up to four consecutive `normal` at the
start of a font shorthand value.
2023-07-04 16:25:23 +02:00
Andreas Kling 793c2ff65a LibWeb: Improve align-items in abspos static position of flex child
Basically, just support more values. And add a test. :^)
2023-07-04 16:25:23 +02:00
Andreas Kling 80a734d42e LibWeb: Improve justify-content in abspos static position of flex child
Also, add a test so we know these actually work correctly now. :^)
2023-07-04 16:25:23 +02:00
Jelle Raaijmakers 859ac200b7 Kernel: Decouple Intel HDA interrupt handling from controller
The driver would crash if it was unable to find an output route, and
subsequently the destruction of controller did not invoke
`GenericInterruptHandler::will_be_destroyed()` because on the level of
`AudioController`, that method is unavailable.

By decoupling the interrupt handling from the controller, we get a new
refcounted class that correctly cleans up after itself :^)
2023-07-04 16:24:04 +02:00
Gabriel Dinner-David c9af6c87bf LibWeb: Add ::selection to pseudo elements 2023-07-04 15:53:20 +02:00
Sam Atkins 6d02403e06 FileManager: Restore inline message behavior for inaccessible dirs
Print the correct error from Core::System::chdir() instead of errno, and
display the error in the DirectoryView instead of continuing to show the
previous location's contents.

This regressed in 1dc3ba6ed5.
2023-07-04 12:40:22 +01:00
Andreas Kling 477a96820d LibWeb: Support valign attribute on td elements
This presentational hint maps to the CSS `vertical-align` property.

Fixes #19786.
2023-07-04 13:26:49 +02:00
kleines Filmröllchen a75377d014 LibAudio: Perform seekpoint comparison without subtraction
For very large seekpoint indices, the casts necessary for the "simple"
subtraction comparison will yield wrong and overflowing results.
Therefore, we perform the seekpoint comparison manually instead.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen e82bee86dd LibAudio: Account for 0xFF start byte in FLAC UTF-8 decoder
This specialized UTF-8 decoder is more powerful than a normal UTF-8
decoder anyways, but it couldn't account for the never spec-compliant
0xff start byte. This commit makes that byte behave as expected if
taking UTF-8 to its extreme, even if it is a little silly and likely not
relevant for real applications.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 8bc56c7fb0 LibAudio: Prevent FLAC Rice partitions getting smaller than 1 sample
This would cause an integer underflow leading to us trying to allocate
over 4GB for residual samples.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 952c633a65 LibAudio: Fix 32-bit/64-bit mixup in FLAC sign extend
The bit magic for two's complement sign extension was only sign
extending to 32-bit signed. This issue was exposed by the last commit,
where now we actually use the 64-bit return value.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 59c7ce3d54 LibAudio: Prevent integer overflows in intermediate FLAC calculations
Since we can have up to 32 bits of input data, multiplications may need
up to 63 bits. This was accounted for in some places, but by far not in
all, and oss-fuzz found multiple integer overflows. We now use i64 in
all of the decoding, since we need to rescale samples to float later on
anyways. If a final sample value ends up out of range (and the range can
be a maximum of 32 bits), we may get samples past 1, but that then is a
non-compliant input file, and using over-range samples (and most likely
clipping audio) is considerably less weird than overflowing and
glitching audio.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 9bece0d0da LibAudio: Prevent multiple kinds of buffer overruns in FLAC picture load
The fuzzer found one heap buffer overflow here due to confusion between
u32* and u8* (the given size is for bytes, but we used it for 32-bit
elements, quadrupling it), and it looks like there's an opportunity for
several more. This commit modernizes the picture loader by using
String's built-in stream loader, and also adds several spec-compliance
checks: The MIME type must be ASCII in a specific range, and the picture
description must be UTF-8.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen ab9c18c176 LibAudio: Don't try to resample FLAC frames with sample rate 0
Although this sample rate is more or less bogus, we might as well not
crash.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 2e9e0dfe61 LibAudio: Check that LPC order is smaller than subframe sample count
An LPC predictor (fixed or not) contains as many warm-up samples as its
order. Therefore, the corresponding subframe must have at least this
many samples.

This turns this fuzzer-found crash into a handleable format error.
2023-07-04 12:47:08 +02:00
Jelle Raaijmakers 0487a841c3 Ports: Regenerate SuperTuxKart's ReadMe.md 2023-07-04 12:37:20 +02:00
Dominika Liberda 484f10132d Ports: Add a Super Tux Kart port
Co-Authored-By: Linus Groh <mail@linusgroh.de>
Co-Authored-By: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-Authored-By: lilylunatic <lily@acab.dev>
Co-Authored-By: io_err <quint@guvernator.net>
2023-07-04 12:26:05 +02:00
Dominika Liberda 815fc034ff Ports: Fix building harfbuzz against freetype 2023-07-04 12:26:05 +02:00
MacDue ff402b1b42 file: Add a description for the image/tinyvg mime type 2023-07-04 12:04:32 +02:00
Linus Groh 8aa579d494 Ports: Update URL of pkgconf release tarball
See: 437c2a3218
2023-07-04 10:43:11 +01:00
Andreas Kling fb727332f9 LibWeb: Decode linked style sheets before parsing them
This fixes an issue where a BOM at the head of a style sheet would be
passed verbatim to the parser, who would then interpret it as an ident
token and (after some confusion) fail to parse the first rule, but then
carry on with the rest of the sheet.
2023-07-04 10:45:20 +02:00
Ali Mohammad Pur 251ea54cc8 Ports: Bump the version of make to 4.4.1 2023-07-04 08:35:02 +02:00
Timothy Flynn 260b0451b0 LibLocale: Update to CLDR version 43.1.0
https://cldr.unicode.org/index/downloads/cldr-43#h.qobmda543waj
2023-07-04 07:26:50 +02:00
Nico Weber efad31dac1 Utilities: Add a pdf utility
This utility will learn tricks such as extracting images from PDFs and
dumping tables from PDFs so that we can create code from specs.

It also allows testing LibPDF things in lagom, and allows testing
reading large amounts of PDFs using a shell script.
2023-07-04 06:50:15 +02:00
Andreas Kling e7e454f1d6 LibWeb: Resolve used insets for grid items 2023-07-04 06:43:53 +02:00
Andreas Kling 03ec17fd37 LibWeb: Resolve used insets for flex items 2023-07-04 06:43:53 +02:00