1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

dirmngr: Avoid crash due to an empty crls.d/DIR.txt.

* dirmngr/crlcache.c (check_dir_version): Avoid segv.
--

GnuPG-bug-id: 1842
Debian-bug-id: 776611
This commit is contained in:
Werner Koch 2015-06-09 11:31:06 +02:00
parent abbefdd04d
commit 255dadd76d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -479,7 +479,9 @@ check_dir_version (estream_t *fpadr, const char *fname,
if (lineerr) if (lineerr)
return lineerr; return lineerr;
if (strtol (line+2, NULL, 10) != DBDIRVERSION) /* The !line catches the case of an empty DIR file. We handle this
the same as a non-matching version. */
if (!line || strtol (line+2, NULL, 10) != DBDIRVERSION)
{ {
if (!created && cleanup_on_mismatch) if (!created && cleanup_on_mismatch)
{ {