[PATCH 0/1] MR11051: krnl386: Require 256-byte buffers in get_entry_point.
NE function names and module names can be up to 255 bytes long, plus one byte for the null terminator. The bug was identified by Cursor, which is a mix of LLM models. I wrote the fix myself. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11051
From: Alex Henrie <alexhenrie24@gmail.com> NE function names and module names can be up to 255 bytes long, plus one byte for the null terminator. --- dlls/krnl386.exe16/relay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/krnl386.exe16/relay.c b/dlls/krnl386.exe16/relay.c index 8b53f6bfd05..084d297fb37 100644 --- a/dlls/krnl386.exe16/relay.c +++ b/dlls/krnl386.exe16/relay.c @@ -199,7 +199,7 @@ BOOL SNOOP16_ShowDebugmsgSnoop(const char *module, int ordinal, const char *func * * Return the ordinal, name, and type info corresponding to a CS:IP address. */ -static const CALLFROM16 *get_entry_point( STACK16FRAME *frame, LPSTR module, LPSTR func, WORD *pOrd ) +static const CALLFROM16 *get_entry_point( STACK16FRAME *frame, char module[256], char func[256], WORD *pOrd ) { WORD i, max_offset; register BYTE *p; @@ -390,7 +390,7 @@ int relay_call_from_16( void *entry_point, unsigned char *args16, CONTEXT *conte WORD ordinal; unsigned int i, j, nb_args = 0; int ret_val, args32[20]; - char module[10], func[64]; + char module[256], func[256]; const CALLFROM16 *call; frame = CURRENT_STACK16; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11051
This cannot happen. I don't think that using an LLM to churn out these kinds of "fixes" is a good use of developer resources. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11051#note_141968
This merge request was closed by Alexandre Julliard. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11051
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Alexandre Julliard (@julliard)