27 Jan
2018
27 Jan
'18
6 p.m.
On Fri, 2018-01-26 at 16:29 +0800, xionghu.luo@linux.intel.com wrote:
From: Luo Xionghu xionghu.luo@intel.com
Avoid NULL dereference if function localtime return invalid value.
Signed-off-by: Luo Xionghu xionghu.luo@intel.com
rimage/css.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/rimage/css.c b/rimage/css.c index f662f0b..064a75a 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -33,6 +33,9 @@ void ri_css_hdr_create(struct image *image) /* get local time and date */ gettimeofday(&tv, NULL); date = localtime(&tv.tv_sec);
- if (date == NULL)
Can we print an error here.
return;
- date->tm_year += 1900; fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", date->tm_year, date->tm_mon, date->tm_mday);