]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Address static analysis warning
authorDimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Thu, 18 Sep 2025 18:45:05 +0000 (20:45 +0200)
committerDimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Fri, 19 Sep 2025 17:17:53 +0000 (19:17 +0200)
yubikey.c:421:13: warning: The left operand of '!=' is a garbage value [core.UndefinedBinaryOperatorResult]
  421 |                         if (type != NAME_LIST_TAG || tlvlen < 1) {
      |                             ~~~~ ^

Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
yubikey.c

index 7def1bd1c8ddbcafa0d18c655177f83f2297a5c4..368e41633a42618dd7ba9dc37b99669d74d56565 100644 (file)
--- a/yubikey.c
+++ b/yubikey.c
@@ -418,7 +418,7 @@ int set_yubikey_mode(struct openconnect_info *vpninfo, const char *token_str)
                        unsigned char mode, hash;
 
                        tlvlen = buf_tlv(buf, &tlvpos, &type);
-                       if (type != NAME_LIST_TAG || tlvlen < 1) {
+                       if (tlvlen < 1 || type != NAME_LIST_TAG) {
                        bad_applet:
                                vpn_progress(vpninfo, PRG_ERR,
                                             _("Unrecognised response from ykneo-oath applet\n"));