]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Cast lifetime to u_long for comparison to prevent unsigned
authordtucker@openbsd.org <dtucker@openbsd.org>
Mon, 16 Mar 2020 02:17:02 +0000 (02:17 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Mon, 16 Mar 2020 22:48:36 +0000 (09:48 +1100)
comparison warning on 32bit arches.  Spotted by deraadt, ok djm.

OpenBSD-Commit-ID: 7a75b2540bff5ab4fa00b4d595db1df13bb0515a

ssh-add.c

index c7bb02cb0c5fb1713c5dbe72e4618676bacc9fb8..a40198ab588774d209d4eda253139c29ff1f2864 100644 (file)
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.154 2020/02/26 13:40:09 jsg Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.155 2020/03/16 02:17:02 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -718,7 +718,7 @@ main(int argc, char **argv)
                        break;
                case 't':
                        if ((lifetime = convtime(optarg)) == -1 ||
-                           lifetime < 0 || lifetime > UINT32_MAX) {
+                           lifetime < 0 || (u_long)lifetime > UINT32_MAX) {
                                fprintf(stderr, "Invalid lifetime\n");
                                ret = 1;
                                goto done;