lkml.org 
[lkml]   [2018]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-03-06 19:22    [W:0.032 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site