[PATCH 0/1] MR9309: reg: Make sure empty is big enough.
We access data[1], so empty needs to have a size of 2. Found by ASan. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9309
From: Yuxuan Shui <yshui(a)codeweavers.com> We access data[1], so empty needs to have a size of 2. Found by ASan. --- programs/reg/add.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/reg/add.c b/programs/reg/add.c index e0cd0373339..2817ce4c3b4 100644 --- a/programs/reg/add.c +++ b/programs/reg/add.c @@ -51,11 +51,11 @@ static inline BYTE hexchar_to_byte(WCHAR ch) static BOOL get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, BYTE **data_bytes, DWORD *size_bytes) { - static const WCHAR empty; + static const WCHAR empty[2]; *size_bytes = 0; - if (!data) data = ∅ + if (!data) data = empty; switch (reg_type) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9309
There would be the same issue if the caller passed an empty string. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9309#note_120111
participants (3)
-
Alexandre Julliard (@julliard) -
Yuxuan Shui -
Yuxuan Shui (@yshui)