mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Fixed potential crash when empty ANSI_STRING or UNICODE_STRING is printed
svn path=/trunk/; revision=1931
This commit is contained in:
parent
8c8de10906
commit
2c92d6e39b
8 changed files with 20 additions and 20 deletions
|
@ -698,7 +698,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
if (qualifier == 'w') {
|
if (qualifier == 'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
|
@ -709,7 +709,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
|
|
|
@ -700,7 +700,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
|
||||||
if (qualifier == L'w') {
|
if (qualifier == L'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
putwc(*sw++, f);
|
putwc(*sw++, f);
|
||||||
|
@ -711,7 +711,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
putwc(*sw++, f);
|
putwc(*sw++, f);
|
||||||
|
|
|
@ -698,7 +698,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
if (qualifier == 'w') {
|
if (qualifier == 'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
|
@ -709,7 +709,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
putc(*s++, f);
|
putc(*s++, f);
|
||||||
|
|
|
@ -700,7 +700,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
|
||||||
if (qualifier == L'w') {
|
if (qualifier == L'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
putwc(*sw++, f);
|
putwc(*sw++, f);
|
||||||
|
@ -711,7 +711,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
putwc(*sw++, f);
|
putwc(*sw++, f);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: sprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $
|
/* $Id: sprintf.c,v 1.5 2001/05/30 14:37:25 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -314,7 +314,7 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
|
||||||
if (qualifier == 'w') {
|
if (qualifier == 'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
*str++ = *s++;
|
*str++ = *s++;
|
||||||
|
@ -325,7 +325,7 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
*str++ = *s++;
|
*str++ = *s++;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: swprintf.c,v 1.6 2001/02/19 15:04:51 dwelch Exp $
|
/* $Id: swprintf.c,v 1.7 2001/05/30 14:37:25 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -326,7 +326,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
|
||||||
if (qualifier == 'h') {
|
if (qualifier == 'h') {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
*str++ = *sw++;
|
*str++ = *sw++;
|
||||||
|
@ -337,7 +337,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
*str++ = *sw++;
|
*str++ = *sw++;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: sprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $
|
/* $Id: sprintf.c,v 1.5 2001/05/30 14:36:52 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -313,7 +313,7 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
|
||||||
if (qualifier == 'w') {
|
if (qualifier == 'w') {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
*str++ = *s++;
|
*str++ = *s++;
|
||||||
|
@ -324,7 +324,7 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
s = "<NULL>";
|
s = "<NULL>";
|
||||||
while ((*s) != 0)
|
while ((*s) != 0)
|
||||||
*str++ = *s++;
|
*str++ = *s++;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: swprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $
|
/* $Id: swprintf.c,v 1.5 2001/05/30 14:36:52 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -325,7 +325,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
|
||||||
if (qualifier == 'h') {
|
if (qualifier == 'h') {
|
||||||
/* print counted ascii string */
|
/* print counted ascii string */
|
||||||
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
PANSI_STRING pus = va_arg(args, PANSI_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
*str++ = *sw++;
|
*str++ = *sw++;
|
||||||
|
@ -336,7 +336,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
|
||||||
} else {
|
} else {
|
||||||
/* print counted unicode string */
|
/* print counted unicode string */
|
||||||
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
|
||||||
if (pus == NULL) {
|
if ((pus == NULL) || (pus->Buffer == NULL)) {
|
||||||
sw = L"<NULL>";
|
sw = L"<NULL>";
|
||||||
while ((*sw) != 0)
|
while ((*sw) != 0)
|
||||||
*str++ = *sw++;
|
*str++ = *sw++;
|
||||||
|
|
Loading…
Reference in a new issue