Commit 6cee83a6 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedbg: Protect fetch_float() in CPU backends against buffer overflow.

parent 0ed49fab
......@@ -1859,6 +1859,7 @@ static BOOL be_arm_fetch_float(const struct dbg_lvalue* lvalue, unsigned size, d
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if (size > sizeof(tmp)) return FALSE;
if (!memory_read_value(lvalue, size, tmp)) return FALSE;
if (size == sizeof(float)) *ret = *(float*)tmp;
......
......@@ -256,6 +256,7 @@ static BOOL be_arm64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if (size > sizeof(tmp)) return FALSE;
if (!memory_read_value(lvalue, size, tmp)) return FALSE;
if (size == sizeof(float)) *ret = *(float*)tmp;
......
......@@ -805,6 +805,7 @@ static BOOL be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if (size > sizeof(tmp)) return FALSE;
if (!memory_read_value(lvalue, size, tmp)) return FALSE;
if (size == sizeof(float)) *ret = *(float*)tmp;
......
......@@ -727,6 +727,7 @@ static BOOL be_x86_64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if (size > sizeof(tmp)) return FALSE;
if (!memory_read_value(lvalue, size, tmp)) return FALSE;
if (size == sizeof(float)) *ret = *(float*)tmp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment