public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: James Prestwood <prestwoj@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH] handshake: don't print NULL pmksa pointer
Date: Mon, 6 Jan 2025 09:14:19 -0600	[thread overview]
Message-ID: <9bbdd1b7-8fc4-497f-8ac8-80871df4a8dc@gmail.com> (raw)
In-Reply-To: <20250106134606.115334-1-prestwoj@gmail.com>

Hi James,

On 1/6/25 7:46 AM, James Prestwood wrote:
> This is undefined behavior so if no pmksa is found don't print.
> ---
>   src/handshake.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/handshake.c b/src/handshake.c
> index f73f91d1..bee76b26 100644
> --- a/src/handshake.c
> +++ b/src/handshake.c
> @@ -1272,11 +1272,11 @@ void handshake_state_cache_pmksa(struct handshake_state *s)
>   {
>   	struct pmksa *pmksa = handshake_state_steal_pmksa(s);
>   
> -	l_debug("%p", pmksa);
> -

Why is this behavior undefined? Would it not just print 0x0000...?

>   	if (!pmksa)
>   		return;
>   
> +	l_debug("%p", pmksa);
> +
>   	if (L_WARN_ON(pmksa_cache_put(pmksa) < 0))
>   		l_free(pmksa);
>   }

Regards,
-Denis

  reply	other threads:[~2025-01-06 15:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06 13:46 [PATCH] handshake: don't print NULL pmksa pointer James Prestwood
2025-01-06 15:14 ` Denis Kenzior [this message]
2025-01-06 15:26   ` James Prestwood
2025-01-06 15:27     ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bbdd1b7-8fc4-497f-8ac8-80871df4a8dc@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox