lkml.org 
[lkml]   [2019]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/9] rtl8192*: display ESSIDs using %pE
On Thu, Sep 05, 2019 at 01:53:43PM -0700, Kees Cook wrote:
> On Thu, Sep 05, 2019 at 03:44:25PM -0400, J. Bruce Fields wrote:
> > From: "J. Bruce Fields" <bfields@redhat.com>
> >
> > Everywhere else in the kernel ESSIDs are printed using %pE, and I can't
> > see why there should be an exception here.
>
> I would expand this rationale slightly: using "n" here makes no sense
> because they are already NUL-terminated strings. The "n" modifier could
> only be used with string_escape_mem() which takes a "length" argument.

SSID may have NUL in any location in the name.

> > - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid);
> > + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid);

> > - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid);
> > + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid);

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2019-09-06 11:38    [W:0.120 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site