We access data[1], so empty needs to have a size of 2.
Found by ASan.
From: Yuxuan Shui yshui@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) {
There would be the same issue if the caller passed an empty string.