From c8ea73caabcb16ffb74baa70d35650027ed772c4 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Mon, 23 May 2011 23:10:37 +0200 Subject: ui-repolist.c: do not return random/stale data from read_agefile When git/date.c:parse_date() cannot parse its input it returns -1. But read_agefile() checks if the result is different from zero, essentialy returning random data from the date buffer when parsing fails. This patch fixes the issue by verifying that the result from parse_date() is positive. Noticed-by: Julius Plenz Signed-off-by: Lars Hjemli --- ui-repolist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui-repolist.c') diff --git a/ui-repolist.c b/ui-repolist.c index 2c98668..e138f59 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -20,7 +20,7 @@ time_t read_agefile(char *path) if (readfile(path, &buf, &size)) return -1; - if (parse_date(buf, buf2, sizeof(buf2))) + if (parse_date(buf, buf2, sizeof(buf2)) > 0) result = strtoul(buf2, NULL, 10); else result = 0; -- cgit 1.4.1 NSE?follow=1'>log tree commit diff
Commit message (Expand)Author
2019-01-14Document old=new argument of fc -sJune McEnroe
2019-01-14Allow replacing empty string with fc old=newJune McEnroe
2019-01-13Enable warnings in libeditJune McEnroe
2019-01-13Show full path in RPS1June McEnroe
2019-01-13Shorten $HOME to ~ in prompt expansionJune McEnroe
2019-01-13Document PSlitJune McEnroe
2019-01-13Document PS0June McEnroe
2019-01-13Set PS0 in cashJune McEnroe
2019-01-13Add PS0June McEnroe
2019-01-13Change default ENV from cashrc to env.shJune McEnroe
2019-01-13Use colours in cash promptsJune McEnroe
2019-01-12Set PSlit like NetBSD shJune McEnroe
2019-01-12Install gnupg2 from pkgsrc and symlink gpgJune McEnroe
2019-01-12Reference cash builtin man pages in cash.1 SEE ALSOJune McEnroe
2019-01-12Restore cash builtin man page datesJune McEnroe
2019-01-12Use local libeditJune McEnroe
2019-01-12Replace libedit MakefileJune McEnroe
2019-01-11Import /usr/src/lib/libedit from NetBSD 8.0June McEnroe
2019-01-11Add PSlit for prompt escapesJune McEnroe
2019-01-11Don't make depend automaticallyJune McEnroe