Commit Graph

6287 Commits

Author SHA1 Message Date
gingerBill
539e9bd2e3 Merge pull request #4836 from laytan/fix-wrong-out-of-memory
fix wrong out of memory in edge cases, just try allocate from block for one source of truth
2025-03-20 17:20:26 +00:00
gingerBill
408b3af550 Merge pull request #4933 from laytan/js-open-binding
core/sys/wasm/js: add `open` binding to `window.open`
2025-03-13 09:22:20 +00:00
gingerBill
35340de928 Merge pull request #4932 from laytan/js-pointer-event-and-charcode
core/sys/wasm/js: add pointer event info and add charCode to keyboard
2025-03-13 09:22:03 +00:00
gingerBill
5a12190f51 Merge pull request #4931 from laytan/webgl-improvements
webgl: add `BlendEquationSeparate` and `GetParameter4i`
2025-03-13 09:21:44 +00:00
Laytan Laats
6691acfa03 core/sys/wasm/js: add open binding to window.open 2025-03-12 18:43:03 +01:00
Laytan Laats
b76fd84084 webgl: add BlendEquationSeparate and GetParameter4i
`GetParameter4i` can be used to retrieve the current scissor rect, or
the curent viewport, which was previously impossible.

Also adds `BlendEquationSeparate` which seemed to be missing.

Also removes an instance of `do`.
2025-03-12 18:39:57 +01:00
Laytan Laats
00ac48c06c core/sys/wasm/js: add pointer event info and add charCode to keyboard events 2025-03-12 18:37:42 +01:00
Laytan Laats
d349c96071 core/sys/wasm/js: improve gamepad API
1. Properly set `id` and `mapping` on the `get_gamepad_state` result
2. Increase `id` limit to 96 bytes, connecting my DualShock 4 made it crash
3. If an `id` or `mapping` is longer than the limits, slice it and add `...`
2025-03-12 18:32:51 +01:00
jason
ae02ced175 Fix linux.rt_sigaction
Add missing polymorphic parameter to Sig_Action
2025-03-10 20:27:59 -04:00
gingerBill
6837e23e73 Merge pull request #4919 from latedeployment/add-linux-syscalls
Add missing x86 syscalls from map_shadow_stack to removexattrat
2025-03-10 17:29:32 +00:00
Adam Zadrożny
7866f7ab2b Update fmt docs for procedures with a default allocator parameter 2025-03-09 13:35:12 +01:00
latedeployment
0491ad55f4 Add missing syscalls from map_shadow_stack to removexattrat 2025-03-07 21:54:51 +02:00
flysand7
47eefb3f21 [datetime]: Remove the definition of EPOCH 2025-03-06 20:28:12 +11:00
Feoramund
fef5f526f3 Remove unneeded slicing in strings.clone 2025-03-05 13:54:31 -05:00
Feoramund
2ab1ca29e6 Fix data races in os2/env_linux.odin
Switched to a recursive mutex so that procedures which need to perform
lookups can do so while also maintaining the lock across their entire
body in order to guarantee atomicity for each environment operation.
2025-03-04 19:32:05 -05:00
Feoramund
179e5b9266 Fix typo 2025-03-04 19:12:45 -05:00
Feoramund
266f15b672 Fix indentation 2025-03-04 19:11:32 -05:00
Feoramund
2d0dc44636 Shorten buffers used for os2.random_string results
This is needed now that `os2.random_string` fills the whole slice.
2025-03-03 19:18:54 -05:00
Feoramund
d6002d68a2 Make os2.random_string use context.random_generator
This removes the data race caused by multiple threads using the
unprotected global `random_string_seed`, so long as no two threads share
the same random generator; this is the default case.

Additionally, `os2.random_string` now takes into account the full buffer
slice given to it.
2025-03-03 19:17:29 -05:00
Laytan Laats
189b4782fb dynlib: fix initialize_symbols when there is no field for the handle in the struct 2025-03-03 20:33:33 +01:00
Laytan Laats
05add96fc8 sys/windows: fix tabs 2025-03-03 19:30:22 +01:00
Feoramund
675bffce88 Add missing allocator in os2.file_info_clone 2025-03-02 17:22:43 -05:00
Feoramund
7d1fcfa09b Fix wrong path in os2.user_config_dir 2025-03-02 17:22:40 -05:00
alektron
fd539b5e81 Fix: When resizing a virtual arena by commiting more of the already reserved memory, the total_used field of the arena was not updated; 2025-03-02 17:46:39 +01:00
Jeroen van Rijn
7841d0b14b Merge pull request #4884 from Dzentsetsu/master
Add DWM_WINDOW_CORNER_PREFERENCE enum for window corner preferences
2025-03-02 13:50:00 +01:00
gingerBill
3963ad1cc1 Update core/sys/windows/dwmapi.odin
Co-authored-by: Laytan <laytanlaats@hotmail.com>
2025-03-02 12:24:45 +00:00
flysand7
70daf40cb1 Fix documentation for simd_shuffle 2025-03-02 20:42:13 +11:00
flysand7
698c510ba7 Merge branch 'master' into docs-simd 2025-03-02 20:05:55 +11:00
Laytan
bb20b03f2e Merge pull request #4887 from Skytrias/skytrias-orca-ui-update
Update to newest orca bindings (UI Update)
2025-03-01 13:58:55 +01:00
Michael Kutowski
57a1264450 proper enums 2025-03-01 13:33:23 +01:00
gingerBill
bb429696f8 Merge pull request #4877 from laytan/os2-additions
os/os2: recursive directory walker, expose errors in read_directory, file clone
2025-02-28 14:37:47 +00:00
gingerBill
8a8894a981 Merge pull request #4891 from Feoramund/fix-4890
Fix #4890
2025-02-28 14:08:27 +00:00
gingerBill
79944056b9 Add Error to os2.set_env 2025-02-28 13:52:51 +00:00
gingerBill
b3bbb00f1a Add Error as part of the return values of os2.environ 2025-02-28 13:43:50 +00:00
Feoramund
b2e3b34ce0 Fix #4890
`strings.to_cstring` previously would not check if the buffer could
handle the extra null byte and could lead to segmentation violations
when using the resulting string in an API expecting the terminator.
2025-02-27 18:54:38 -05:00
Michael Kutowski
43c54d4de8 Update to newest orca bindings (UI Update), remove logging due to cyclic import (fmt usage) 2025-02-26 23:03:44 +01:00
Roman Osipov
a1597022af Add DWM_WINDOW_CORNER_PREFERENCE enum for window corner preferences 2025-02-26 12:23:49 +03:00
Githubaccountlol
88f423a38b Update doc.odin 2025-02-26 03:04:54 -06:00
gingerBill
cae91c9472 Fix rune printing with %b 2025-02-25 15:53:06 +00:00
Laytan Laats
22ab8935c4 slice: use card in bitset_to_enum_slice_with_make
Fixes #4870
2025-02-24 21:10:12 +01:00
Laytan Laats
0e4140a602 os/os2: recursive directory walker, expose errors in read_directory, file clone
Adds a directory walker, a method of exposing and retrieving errors from
the existing read directory iterator, allows reusing of the existing
read directory iterator, and adds a file clone procedure
2025-02-24 20:40:44 +01:00
gingerBill
0781526b35 Merge pull request #4466 from Barinzaya/simd_extract_msbs
SIMD Extract MSbs/LSbs Intrinsics
2025-02-24 14:04:07 +00:00
Barinzaya
4afedbc051 Added simd_extract_lsbs intrinsic as well.
Equivalent to the simd_extract_msbs intrinsic, except it extracts the
least significant bit of each element instead.
2025-02-24 08:49:57 -05:00
gingerBill
ef016d957b Add @(require_results) to random generator 2025-02-24 13:48:07 +00:00
Barinzaya
33a3aab791 Added simd_extract_msbs intrinsic. 2025-02-24 08:39:32 -05:00
Keenan Woodall
a709876788 SavePanel_URL returns ^URL instead of ^Array 2025-02-23 19:00:27 -06:00
Christiano Haesbaert
42d7e7a402 Fix multiple vulnerabilities in the resolver
This fixes some vulnerabilities in the resolver that make spoofing DNS
queries somewhat trivial due to the code failing to randomize xid, as
well as match the reply xid with the query, and the origin of the packet:

 - xid of the query was fixed at zero
 - xid from the reply was never checked
 - source address of the reply was never checked

This means anyone can flood the host with a fake reply with xid 0,
guessing the source port is trivial as it's less than 16bits (2^16 -
1024), which would cause odin to resolve a hostname to whatever an
attacker wanted.

While here also plug in two memory leaks.

Since this is CVE material, I've contacted @kelimion before hand which
instructed to put it in a PR.

There are also more bugs as the code conflates answer section,
authority section and aditional section into one, while in reality
only the anwer section should be taken into consideration.
2025-02-23 17:28:32 +01:00
Jeroen van Rijn
940da61869 Fix missing error when TCP connection refused.
Fixes #4867
2025-02-23 12:47:22 +01:00
gingerBill
9dc4d5a4e6 Merge pull request #4845 from Barinzaya/fmt_variable_wp_without_index
Variable Width/Precision Without Index in `fmt`
2025-02-20 08:49:48 +00:00
Laytan Laats
cae3f13d9f mem/virtual: specify max protection on mmap call in NetBSD and FreeBSD 2025-02-18 18:33:19 +01:00