Bugzilla – Attachment 3466 Details for
Bug 3250
Integer overflow in ConnectTimeout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
convtime return long -> int
ssh-convtime-int.patch (text/plain), 3.61 KB, created by
Darren Tucker
on 2021-01-11 11:37:20 AEDT
(
hide
)
Description:
convtime return long -> int
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2021-01-11 11:37:20 AEDT
Size:
3.61 KB
patch
obsolete
>Index: misc.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.c,v >retrieving revision 1.157 >diff -u -p -r1.157 misc.c >--- misc.c 22 Dec 2020 00:12:22 -0000 1.157 >+++ misc.c 11 Jan 2021 00:13:58 -0000 >@@ -497,7 +497,7 @@ a2tun(const char *s, int *remote) > * > * Return -1 if time string is invalid. > */ >-long >+int > convtime(const char *s) > { > long total, secs, multiplier; >@@ -514,7 +514,7 @@ convtime(const char *s) > while (*p) { > secs = strtol(p, &endp, 10); > if (p == endp || >- (errno == ERANGE && (secs == LONG_MIN || secs == LONG_MAX)) || >+ (errno == ERANGE && (secs == INT_MIN || secs == INT_MAX)) || > secs < 0) > return -1; > >@@ -545,10 +545,10 @@ convtime(const char *s) > default: > return -1; > } >- if (secs >= LONG_MAX / multiplier) >+ if (secs >= INT_MAX / multiplier) > return -1; > secs *= multiplier; >- if (total >= LONG_MAX - secs) >+ if (total >= INT_MAX - secs) > return -1; > total += secs; > if (total < 0) >Index: misc.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.h,v >retrieving revision 1.91 >diff -u -p -r1.91 misc.h >--- misc.h 22 Dec 2020 00:12:22 -0000 1.91 >+++ misc.h 11 Jan 2021 00:13:58 -0000 >@@ -67,7 +67,7 @@ char *colon(char *); > int parse_user_host_path(const char *, char **, char **, char **); > int parse_user_host_port(const char *, char **, char **, int *); > int parse_uri(const char *, const char *, char **, char **, int *, char **); >-long convtime(const char *); >+int convtime(const char *); > const char *fmt_timeframe(time_t t); > char *tilde_expand_filename(const char *, uid_t); > >Index: ssh-add.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh-add.c,v >retrieving revision 1.158 >diff -u -p -r1.158 ssh-add.c >--- ssh-add.c 18 Oct 2020 11:32:02 -0000 1.158 >+++ ssh-add.c 11 Jan 2021 00:13:58 -0000 >@@ -84,7 +84,7 @@ static char *default_files[] = { > static int fingerprint_hash = SSH_FP_HASH_DEFAULT; > > /* Default lifetime (0 == forever) */ >-static long lifetime = 0; >+static int lifetime = 0; > > /* User has to confirm key use */ > static int confirm = 0; >@@ -365,7 +365,7 @@ add_file(int agent_fd, const char *filen > filename, comment); > if (lifetime != 0) { > fprintf(stderr, >- "Lifetime set to %ld seconds\n", lifetime); >+ "Lifetime set to %d seconds\n", lifetime); > } > if (confirm != 0) { > fprintf(stderr, "The user must confirm " >@@ -420,7 +420,7 @@ add_file(int agent_fd, const char *filen > fprintf(stderr, "Certificate added: %s (%s)\n", certpath, > private->cert->key_id); > if (lifetime != 0) { >- fprintf(stderr, "Lifetime set to %ld seconds\n", >+ fprintf(stderr, "Lifetime set to %d seconds\n", > lifetime); > } > if (confirm != 0) { >@@ -603,7 +603,7 @@ load_resident_keys(int agent_fd, const c > sshkey_type(keys[i]), fp); > if (lifetime != 0) { > fprintf(stderr, >- "Lifetime set to %ld seconds\n", lifetime); >+ "Lifetime set to %d seconds\n", lifetime); > } > if (confirm != 0) { > fprintf(stderr, "The user must confirm " >Index: ssh-agent.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh-agent.c,v >retrieving revision 1.267 >diff -u -p -r1.267 ssh-agent.c >--- ssh-agent.c 8 Nov 2020 22:37:24 -0000 1.267 >+++ ssh-agent.c 11 Jan 2021 00:13:58 -0000 >@@ -150,7 +150,7 @@ u_char lock_salt[LOCK_SALT_SIZE]; > extern char *__progname; > > /* Default lifetime in seconds (0 == forever) */ >-static long lifetime = 0; >+static int lifetime = 0; > > static int fingerprint_hash = SSH_FP_HASH_DEFAULT; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3250
:
3465
| 3466