Commit 8bcb3ba1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] make printk more robust with "null" pointers

Expand printk's traditional handling of null pointers so that anything in the
first page is considered a null pointer.

This gives us better behaviour when someone (acpi..) accidentally prints a
string which is embedded in a struct, the pointer to which is null.
parent fcd84957
...@@ -348,7 +348,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) ...@@ -348,7 +348,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
case 's': case 's':
s = va_arg(args, char *); s = va_arg(args, char *);
if (!s) if ((unsigned long)s < PAGE_SIZE)
s = "<NULL>"; s = "<NULL>";
len = strnlen(s, precision); len = strnlen(s, precision);
......
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