mirror of
https://codeberg.org/Limine/Limine
synced 2026-01-26 05:07:54 +00:00
limine: Fix internal module path corruption from static URI buffer
This commit is contained in:
parent
9659672e09
commit
89df8597a1
@ -443,6 +443,10 @@ noreturn void limine_load(char *config, char *cmdline) {
|
||||
strcpy(k_path_copy, kernel_path);
|
||||
char *k_resource = NULL, *k_root = NULL, *k_path = NULL, *k_hash = NULL;
|
||||
uri_resolve(k_path_copy, &k_resource, &k_root, &k_path, &k_hash);
|
||||
// Copy k_resource and k_root since uri_resolve returns pointers to a static
|
||||
// buffer that gets overwritten by subsequent uri_open/uri_resolve calls
|
||||
k_resource = strdup(k_resource);
|
||||
k_root = strdup(k_root);
|
||||
char *k_path_ = ext_mem_alloc(strlen(k_path) + 2);
|
||||
k_path_[0] = '/';
|
||||
strcpy(k_path_ + 1, k_path);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user