[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201909051352.89D121A4@keescook>
Date: Thu, 5 Sep 2019 13:53:43 -0700
From: Kees Cook <keescook@...omium.org>
To: "J. Bruce Fields" <bfields@...hat.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/9] rtl8192*: display ESSIDs using %pE
On Thu, Sep 05, 2019 at 03:44:25PM -0400, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@...hat.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.
Regardless:
Acked-by: Kees Cook <keescook@...omium.org>
-Kees
>
> Signed-off-by: J. Bruce Fields <bfields@...hat.com>
> ---
> drivers/staging/rtl8192e/rtllib.h | 2 +-
> drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
> index 2dd57e88276e..096254e422b3 100644
> --- a/drivers/staging/rtl8192e/rtllib.h
> +++ b/drivers/staging/rtl8192e/rtllib.h
> @@ -2132,7 +2132,7 @@ static inline const char *escape_essid(const char *essid, u8 essid_len)
> return escaped;
> }
>
> - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid);
> + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid);
> return escaped;
> }
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> index d36963469015..3963a08b9eb2 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> @@ -2426,7 +2426,7 @@ static inline const char *escape_essid(const char *essid, u8 essid_len)
> return escaped;
> }
>
> - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid);
> + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid);
> return escaped;
> }
>
> --
> 2.21.0
>
--
Kees Cook
Powered by blists - more mailing lists