rpcrt4: Fix buffer overflow in UUID tests.

Rob Shearman robertshearman at gmail.com
Sun Jan 25 11:07:20 CST 2009


Fix the format string used by printGuid. Use snprintf instead of
sprintf to avoid these kinds of problems in the code in the future and
pass the buffer size into printGuid.

Use the assignment operator instead of memcpy to get type checking for
the "and" and "or" variables.
---
 dlls/rpcrt4/tests/rpc.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

This buffer overflow caused the first byte of the "or" variable to be
overwritten for me and cause a test failure, when using the following
compiler:
$ gcc --version
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7f841bfd62ab48466771c3f21a59776b72347d0f.diff
Type: text/x-patch
Size: 1792 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20090125/add46b87/attachment.bin 


More information about the wine-patches mailing list