mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 23:21:23 +00:00
Fixed debug print to not overflow the stack on long prints.
Increased buffer from 512 to 1024 bytes, and truncate string using _vsnprintf() svn path=/trunk/; revision=2650
This commit is contained in:
parent
9594f61e1f
commit
f83db8cc84
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: print.c,v 1.12 2001/03/16 18:11:21 dwelch Exp $
|
/* $Id: print.c,v 1.13 2002/02/25 22:45:04 phreak Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -57,7 +57,7 @@ ULONG
|
||||||
DbgPrint(PCH Format, ...)
|
DbgPrint(PCH Format, ...)
|
||||||
{
|
{
|
||||||
ANSI_STRING DebugString;
|
ANSI_STRING DebugString;
|
||||||
CHAR Buffer[512];
|
CHAR Buffer[1024];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
/* init ansi string */
|
/* init ansi string */
|
||||||
|
@ -65,7 +65,7 @@ DbgPrint(PCH Format, ...)
|
||||||
DebugString.MaximumLength = 512;
|
DebugString.MaximumLength = 512;
|
||||||
|
|
||||||
va_start (ap, Format);
|
va_start (ap, Format);
|
||||||
DebugString.Length = vsprintf (Buffer, Format, ap);
|
DebugString.Length = _vsnprintf (Buffer, sizeof( Buffer ), Format, ap);
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
|
|
||||||
KdpPrintString (&DebugString);
|
KdpPrintString (&DebugString);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue