On 24.04.2016 18:50, Aaryaman Vasishta wrote:
This size of class name turns out to be equal to sizeof("Texture") which is strlen("Texture") + 1. This was recently discovered while testing the size returned by GetClassName.
Signed-off-by: Aaryaman Vasishta jem456.vasishta@gmail.com
dlls/d3drm/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3drm/texture.c b/dlls/d3drm/texture.c index f81fc03..60374d3 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -796,7 +796,7 @@ static HRESULT WINAPI d3drm_texture3_GetClassName(IDirect3DRMTexture3 *iface, DW { TRACE("iface %p, size %p, name %p.\n", iface, size, name);
- if (!size || *size < strlen("Texture") || !name)
if (!size || *size < sizeof("Texture") || !name) return E_INVALIDARG;
strcpy(name, "Texture");
GetClassName() is duplicated for every object, it makes sense to introduce a helper function eventually.
Agreed, a seperate patch could be written for that.
Cheers, Aaryaman
On Sun, Apr 24, 2016 at 9:44 PM, Nikolay Sivov bunglehead@gmail.com wrote:
On 24.04.2016 18:50, Aaryaman Vasishta wrote:
This size of class name turns out to be equal to sizeof("Texture") which
is strlen("Texture") + 1. This was recently discovered while testing the size returned by GetClassName.
Signed-off-by: Aaryaman Vasishta jem456.vasishta@gmail.com
dlls/d3drm/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3drm/texture.c b/dlls/d3drm/texture.c index f81fc03..60374d3 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -796,7 +796,7 @@ static HRESULT WINAPI
d3drm_texture3_GetClassName(IDirect3DRMTexture3 *iface, DW
{ TRACE("iface %p, size %p, name %p.\n", iface, size, name);
- if (!size || *size < strlen("Texture") || !name)
if (!size || *size < sizeof("Texture") || !name) return E_INVALIDARG;
strcpy(name, "Texture");
GetClassName() is duplicated for every object, it makes sense to introduce a helper function eventually.