View | Details | Raw Unified | Return to bug 3250 | Differences between
and this patch

Collapse All | Expand All

(-)misc.c (-4 / +4 lines)
Lines 497-503 a2tun(const char *s, int *remote) Link Here
497
 *
497
 *
498
 * Return -1 if time string is invalid.
498
 * Return -1 if time string is invalid.
499
 */
499
 */
500
long
500
int
501
convtime(const char *s)
501
convtime(const char *s)
502
{
502
{
503
	long total, secs, multiplier;
503
	long total, secs, multiplier;
Lines 514-520 convtime(const char *s) Link Here
514
	while (*p) {
514
	while (*p) {
515
		secs = strtol(p, &endp, 10);
515
		secs = strtol(p, &endp, 10);
516
		if (p == endp ||
516
		if (p == endp ||
517
		    (errno == ERANGE && (secs == LONG_MIN || secs == LONG_MAX)) ||
517
		    (errno == ERANGE && (secs == INT_MIN || secs == INT_MAX)) ||
518
		    secs < 0)
518
		    secs < 0)
519
			return -1;
519
			return -1;
520
520
Lines 545-554 convtime(const char *s) Link Here
545
		default:
545
		default:
546
			return -1;
546
			return -1;
547
		}
547
		}
548
		if (secs >= LONG_MAX / multiplier)
548
		if (secs >= INT_MAX / multiplier)
549
			return -1;
549
			return -1;
550
		secs *= multiplier;
550
		secs *= multiplier;
551
		if  (total >= LONG_MAX - secs)
551
		if  (total >= INT_MAX - secs)
552
			return -1;
552
			return -1;
553
		total += secs;
553
		total += secs;
554
		if (total < 0)
554
		if (total < 0)
(-)misc.h (-1 / +1 lines)
Lines 67-73 char *colon(char *); Link Here
67
int	 parse_user_host_path(const char *, char **, char **, char **);
67
int	 parse_user_host_path(const char *, char **, char **, char **);
68
int	 parse_user_host_port(const char *, char **, char **, int *);
68
int	 parse_user_host_port(const char *, char **, char **, int *);
69
int	 parse_uri(const char *, const char *, char **, char **, int *, char **);
69
int	 parse_uri(const char *, const char *, char **, char **, int *, char **);
70
long	 convtime(const char *);
70
int	 convtime(const char *);
71
const char *fmt_timeframe(time_t t);
71
const char *fmt_timeframe(time_t t);
72
char	*tilde_expand_filename(const char *, uid_t);
72
char	*tilde_expand_filename(const char *, uid_t);
73
73
(-)ssh-add.c (-4 / +4 lines)
Lines 84-90 static char *default_files[] = { Link Here
84
static int fingerprint_hash = SSH_FP_HASH_DEFAULT;
84
static int fingerprint_hash = SSH_FP_HASH_DEFAULT;
85
85
86
/* Default lifetime (0 == forever) */
86
/* Default lifetime (0 == forever) */
87
static long lifetime = 0;
87
static int lifetime = 0;
88
88
89
/* User has to confirm key use */
89
/* User has to confirm key use */
90
static int confirm = 0;
90
static int confirm = 0;
Lines 365-371 add_file(int agent_fd, const char *filen Link Here
365
			    filename, comment);
365
			    filename, comment);
366
			if (lifetime != 0) {
366
			if (lifetime != 0) {
367
				fprintf(stderr,
367
				fprintf(stderr,
368
				    "Lifetime set to %ld seconds\n", lifetime);
368
				    "Lifetime set to %d seconds\n", lifetime);
369
			}
369
			}
370
			if (confirm != 0) {
370
			if (confirm != 0) {
371
				fprintf(stderr, "The user must confirm "
371
				fprintf(stderr, "The user must confirm "
Lines 420-426 add_file(int agent_fd, const char *filen Link Here
420
		fprintf(stderr, "Certificate added: %s (%s)\n", certpath,
420
		fprintf(stderr, "Certificate added: %s (%s)\n", certpath,
421
		    private->cert->key_id);
421
		    private->cert->key_id);
422
		if (lifetime != 0) {
422
		if (lifetime != 0) {
423
			fprintf(stderr, "Lifetime set to %ld seconds\n",
423
			fprintf(stderr, "Lifetime set to %d seconds\n",
424
			    lifetime);
424
			    lifetime);
425
		}
425
		}
426
		if (confirm != 0) {
426
		if (confirm != 0) {
Lines 603-609 load_resident_keys(int agent_fd, const c Link Here
603
			    sshkey_type(keys[i]), fp);
603
			    sshkey_type(keys[i]), fp);
604
			if (lifetime != 0) {
604
			if (lifetime != 0) {
605
				fprintf(stderr,
605
				fprintf(stderr,
606
				    "Lifetime set to %ld seconds\n", lifetime);
606
				    "Lifetime set to %d seconds\n", lifetime);
607
			}
607
			}
608
			if (confirm != 0) {
608
			if (confirm != 0) {
609
				fprintf(stderr, "The user must confirm "
609
				fprintf(stderr, "The user must confirm "
(-)ssh-agent.c (-1 / +1 lines)
Lines 150-156 u_char lock_salt[LOCK_SALT_SIZE]; Link Here
150
extern char *__progname;
150
extern char *__progname;
151
151
152
/* Default lifetime in seconds (0 == forever) */
152
/* Default lifetime in seconds (0 == forever) */
153
static long lifetime = 0;
153
static int lifetime = 0;
154
154
155
static int fingerprint_hash = SSH_FP_HASH_DEFAULT;
155
static int fingerprint_hash = SSH_FP_HASH_DEFAULT;
156
156

Return to bug 3250