diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-10-21 18:22:28 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-10-21 18:22:28 -0700 |
| commit | 8bcb3ba1dec5749a7f1eed570cb69a20c2e4bd41 (patch) | |
| tree | ead867f458dff4cca8063160c9b94ea6c04e867f /lib | |
| parent | fcd8495785dddfed3035b8662616345c8dfb9383 (diff) | |
[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.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/vsprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 0803ac5438e1..5ae1c3765f4c 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -348,7 +348,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) case 's': s = va_arg(args, char *); - if (!s) + if ((unsigned long)s < PAGE_SIZE) s = "<NULL>"; len = strnlen(s, precision); |
