Messages in this thread | | | Date | Tue, 6 Mar 2018 21:22:17 +0300 | From | Alexey Dobriyan <> | Subject | Re: [PATCH 1/2] vsprintf: distinguish between (null), (err) and (invalid) pointer derefs |
| |
> +#define BAD_PTR_STRING(x) (!(x) ? "(null)" : IS_ERR(x) ? "(err)" : "(invalid)")
This is getting ridiculous.
Instead of simply printing a pointer as %08lx or %016llx, not only glibc (null) stupidity is propagated but expanded and "improved".
I assure you reading 0000000000000000 is just as obvious as (null) and reading fffffffffffffffa is just as good as -ENOMEM.
In fact printing with hex is more information. Maybe it is important that buggy pointer is small value but it's value is lost.
Sure don't dereference a pointer for very small or very erry values but print it without all the bell and whistles.
| |