All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@RedHat.com>
To: Olga Kornievskaia <aglo@umich.edu>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] query_krb5_ccache: Removed dead code that was flagged by a covscan
Date: Sat, 8 Feb 2020 04:21:01 -0500	[thread overview]
Message-ID: <17f9e558-ed00-c377-83b1-9769fd698cc9@RedHat.com> (raw)
In-Reply-To: <CAN-5tyHatMk_xsBW5MHpv7-HyiCMPS9qrz3_O6-XN5KpH_RWtA@mail.gmail.com>



On 2/7/20 12:25 PM, Olga Kornievskaia wrote:
> On Fri, Feb 7, 2020 at 10:22 AM Steve Dickson <steved@redhat.com> wrote:
>>
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>>  utils/gssd/krb5_util.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
>> index bff759f..a1c43d2 100644
>> --- a/utils/gssd/krb5_util.c
>> +++ b/utils/gssd/krb5_util.c
>> @@ -1066,8 +1066,6 @@ query_krb5_ccache(const char* cred_cache, char **ret_princname,
>>                             *ret_realm = strdup(str+1);
>>                     }
>>                     k5_free_unparsed_name(context, princstring);
>> -               } else {
>> -                       found = 0;
>>                 }
> 
> Uhm, sorry wasn't fast enough for you commit decision but I don't see
> that this a dead code? krb5_unparse_string() could return an error so
> "else" is a valid condition. I mean it's probably unlikely that
> check_for_tgt() returns found and they you can't parse the principal
> name out of it. But things like memory errors could still be valid
> error conditions?
Sorry for being so quick with the commit... 

The covscan complained "warning: Value stored to 'found' is never read"
which was true... after setting found = 0, found was never used. 

Yes, the "else" is a valid condition but not necessary since
setting 'found' to zero does not do anything... 

steved.

> 
> 
>>         }
>>         krb5_free_principal(context, principal);
>> --
>> 2.24.1
>>
> 


  reply	other threads:[~2020-02-08  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 15:21 [PATCH] query_krb5_ccache: Removed dead code that was flagged by a covscan Steve Dickson
2020-02-07 16:08 ` Steve Dickson
2020-02-07 17:25 ` Olga Kornievskaia
2020-02-08  9:21   ` Steve Dickson [this message]
2020-02-08 16:05     ` Olga Kornievskaia

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=17f9e558-ed00-c377-83b1-9769fd698cc9@RedHat.com \
    --to=steved@redhat.com \
    --cc=aglo@umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.