Commit graph

12993 commits

Author SHA1 Message Date
Ben Wiederhake
25ccd40d5a Meta: Describe how to analyze an LLVM fuzzer crash 2020-09-12 00:13:29 +02:00
Ben Wiederhake
e550df6467 LibGfx: Don't blindly trust file-internal offset
This also touches the return type of dib_size(), because kjdsfg
2020-09-12 00:13:29 +02:00
Ben Wiederhake
a098046309 LibGfx: Nicer error reporting for bitmap allocation 2020-09-12 00:13:29 +02:00
Ben Wiederhake
52a797afdb LibGfx: Protect against over-large bitmaps 2020-09-12 00:13:29 +02:00
Ben Wiederhake
98bfcb4b57 Meta+LibGfx: Fuzz BMP parsing 2020-09-12 00:13:29 +02:00
Ben Wiederhake
5d3c437cce LibJS: Fix start position of multi-line tokens
This broke in case of unterminated regular expressions, causing goofy location
numbers, and 'source_location_hint' to eat up all memory:

Unexpected token UnterminatedRegexLiteral. Expected statement (line: 2, column: 4294967292)
2020-09-12 00:13:29 +02:00
Ben Wiederhake
0d3a8d5397 AK: Fix accidentally-recursive call in BitStream 2020-09-12 00:13:29 +02:00
AnotherTest
bc9f8f5c39 Userland: Add an implementation of printf 2020-09-11 21:41:23 +02:00
AnotherTest
72edb33670 AK: Generalise 'PrintfImplementation'
This makes PrintfImplementation usable with any sequence, provided that
a 'next element' function can be written for it.
Does not affect the behaviour of printf() and co.
2020-09-11 21:41:23 +02:00
Andreas Kling
b62043dbca LibWeb: Protect LayoutCheckBox against crashes after event dispatch
After dispatching a "change" event due to the checked state being
modified, we may have been removed from the layout tree.

Make LayoutCheckBox protect itself to prevent this from crashing.

Also, add a little test page for checkboxes. :^)
2020-09-11 18:42:43 +02:00
Andreas Kling
71092226bd LibWeb: Dispatch a "change" event when <input> checked state changes 2020-09-11 18:42:43 +02:00
Andreas Kling
f2431adf47 LibWeb: Add basic support for <input type=checkbox>
This is implemented entirely inside LibWeb, there is no GUI::CheckBox
widget instantiated, unlike other input types. All input types should
be moved to this new style of implementation.
2020-09-11 18:42:43 +02:00
Andreas Kling
d6889ecf35 LibWeb: Allow layout nodes to receive and track mouse events
To implement form controls internally in LibWeb (necessary for multi
process forms), we'll need the ability to handle events since we can't
rely on LibGUI widgets anymore.

A LayoutNode can now override wants_mouse_events() and if it returns
true, it will now receive mousedown, mousemove and mouseup events. :^)
2020-09-11 18:42:43 +02:00
Andreas Kling
5782099106 LibWeb: Add basic support for boolean IDL attributes :^) 2020-09-11 18:42:43 +02:00
Andreas Kling
e7432efe24 LibWeb: Add the "checked" and "disabled" HTML attributes 2020-09-11 18:42:43 +02:00
Andreas Kling
1a2b626746 LibGUI+LibGfx: Move check box painting to Gfx::StylePainter
This will allow us to render check boxes from other places. :^)
2020-09-11 18:42:43 +02:00
pkotzbach
072e94caa2
LibCore: Fixed DeferredInvoke debug message (#3456) 2020-09-11 18:41:50 +02:00
asynts
3c03ce0c80 LibCompress: Add unit tests for CanonicalCode. 2020-09-11 16:07:45 +02:00
asynts
5c9c0082a1 LibCompress: Move CanonicalCode out of DeflateDecompressor. 2020-09-11 16:07:45 +02:00
asynts
49e6ff8958 LibCompress: Remove unnecessary InputBitStream. 2020-09-11 16:07:45 +02:00
asynts
4af8eea56f LibCompress: Return Optional from decompress_all method. 2020-09-11 16:07:45 +02:00
asynts
7e02cad476 LibCompress: Use OutputMemoryStream in decompress_all methods. 2020-09-11 16:07:45 +02:00
asynts
b0ba7a897f Userland: gunzip if filename doesn't end in .gz append it.
This is the behaviour of gzip on my Linux system.
2020-09-11 16:07:45 +02:00
asynts
049f709d0b AK: Calculate the chunk index correctly in DuplexMemoryStream. 2020-09-11 16:07:45 +02:00
Andreas Kling
dbd2fa8b8f HackStudio: Use widget override cursors 2020-09-11 16:06:00 +02:00
Andreas Kling
d76b2d0baa LibGUI: Use widget override cursors in ColorInput 2020-09-11 14:51:02 +02:00
Andreas Kling
cab422b441 LibGUI: Use widget override cursors in HeaderView 2020-09-11 14:50:30 +02:00
Andreas Kling
69adaf3308 LibGUI: Use widget override cursors in GUI::ResizeCorner 2020-09-11 14:47:38 +02:00
Andreas Kling
8f5b92865d HexEditor: Use widget override cursors 2020-09-11 14:37:30 +02:00
Andreas Kling
5872cb398c LibWeb: Use widget override cursors 2020-09-11 14:28:05 +02:00
Andreas Kling
7a2faecc15 LibGUI: Use widget override cursors in GUI::TextEditor 2020-09-11 14:26:37 +02:00
Andreas Kling
e2050ea0ce LibGUI: Use widget override cursors in GUI::Splitter 2020-09-11 14:26:37 +02:00
Andreas Kling
f475fa3f54 LibVT: Show an I-beam cursor over TerminalWidget
..and implement this using the new widget override cursor mechanism.
2020-09-11 14:26:37 +02:00
Andreas Kling
cf429a788c LibGUI: Add Widget override cursor concept
We got ourselves into a mess by making widgets override the window
cursor whenever they wanted a custom cursor. This patch introduces a
better solution to that issue: per-widget override cursors.

Each widget now has an override cursor that overrides the window
cursor when that widget is hovered.
2020-09-11 14:26:37 +02:00
Andreas Kling
b4f307f982 LibGUI+WindowServer: Rename window "override cursor" to just "cursor"
Let's just say each window has a cursor, there's not really overriding
going on.
2020-09-11 14:26:37 +02:00
Sergey Bugaev
40fbdd4e9e Ports: Add libffi 2020-09-10 19:57:38 +02:00
Tom
0fab0ee96a Kernel: Rename Process::is_ring0/3 to Process::is_kernel/user_process
Since "rings" typically refer to code execution and user processes
can also execute in ring 0, rename these functions to more accurately
describe what they mean: kernel processes and user processes.
2020-09-10 19:57:15 +02:00
Tom
19ffd9d677 Kernel: Fix detecting in what ring a crash happened
The ring is determined based on the CS register. This fixes crashes
being handled as ring 3 crashes even though EIP/CS clearly showed
that the crash happened in the kernel.
2020-09-10 19:57:15 +02:00
Andreas Kling
0f9be82826 LibGfx: Move StandardCursor enum to LibGfx
This enum existed both in LibGUI and WindowServer which was silly and
error-prone.
2020-09-10 19:25:13 +02:00
Andreas Kling
c063a02979 Base: Improved I-beam cursor
Make the I-beam cursor white with a black outline, like all the other
cursors. This makes it show up on dark backgrounds. :^)
2020-09-10 19:05:01 +02:00
Andreas Kling
e860a9aa80 LibGUI: Unregister AbstractView from model on destruction
It was possible to leave stale view pointers in the model after a view
was destroyed while attached to a model.
2020-09-10 18:45:00 +02:00
Andreas Kling
4e0df06f86 IRCClient: Use NonnullRefPtr<IRCClient> throughout
To protect against mishaps during app exit teardown, make sure everyone
who needs to be is a co-owner of the IRCClient object.

Fixes #3451.
2020-09-10 18:45:00 +02:00
Sergey Bugaev
039e529dbe Userland: Fix a signal race condition
It has been possible for a signal to arrive in between us checking
g_interrupted and exiting - sucessfully, even though we were interrupted.

This way, if a signal arrives before we reset the disposition, we
will reliably check for it later; if it arrives afterwards, it'll
kill us automatically.
2020-09-10 16:00:11 +02:00
asynts
0055a28710 AK: Replace LogStream operator for ReadonlyBytes with dump_bytes.
It wasn't actually possible to call

    const LogStream& operator<<(const LogStream&, ReadonlyBytes);

because it was shadowed by

    template<typename T>
    const LogStream& operator<<(const LogStream& stream, Span<T> span);

not sure how I didn't find this when I added the overload.

It would be possible to use SFINAE to disable the other overload,
however, I think it is better to use a different method entirely because
the output can be very verbose:

    void dump_bytes(ReadonlyBytes);
2020-09-10 14:15:02 +02:00
Avery
06218a4074 IPv4: Truncate raw socket reads past buffer length
In addition to being the proper POSIX etiquette, it seems like a bad idea
for issues like the one seen in #3428 to result in a kernel crash. This patch
replaces the current behavior of failing on insufficient buffer size to truncating
SOCK_RAW messages to the buffer size. This will have to change if/when MSG_PEEK
is implemented, but for now this behavior is more compliant and logical than
just bailing.
2020-09-10 12:03:56 +02:00
Nico Weber
61060c0da8 LibVT: Let Terminal keep history in a circular buffer
This makes Terminal::scroll_up() O(1) instead of O(n) in the
size of the history. (It's still O(n) in the size of visible
lines.)

Reduces time to run `disasm /bin/id` with the default terminal
window size from 530ms to 409ms (min-of-5) on my system.
2020-09-10 12:01:26 +02:00
Nico Weber
90d9c83067 LibVT: Let Terminal only expose history_size, not storage 2020-09-10 12:01:26 +02:00
AnotherTest
927e2fc6bc Shell: Do not reset the terminal attributes when command is run in bg
Also removes a FIXME that no longer applies.
2020-09-10 11:20:22 +02:00
AnotherTest
c296bcc1d9 Base: Tweak Shell(5) manpage a bit
Someone brought to my attention that "or missing" is not correct there.
2020-09-10 11:20:22 +02:00
Devashish Jaiswal
2a3166e523
JPGLoader: Check existence of Huffman tables in scan header segment (#3442)
DC and AC table IDs read in the scan header segment weren't validated
against the IDs of Huffman tables read in the DHT segment. This caused
an OOB read when a Huffman table was accessed using the ID read in the
scan header segment. Furthermore, the decoder now replaces the old DC
or AC table if a redefinition has been found prior to the scan header.

Fixes #3439.
2020-09-10 11:20:04 +02:00