mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
common: Check read errors in name-value.c
* common/name-value.c: Check for read errors. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
8fe8105576
commit
fc445b36fa
@ -665,7 +665,7 @@ do_nvc_parse (nvc_t *result, int *errlinep, estream_t stream,
|
||||
|
||||
if (errlinep)
|
||||
*errlinep = 0;
|
||||
while ((len = es_read_line (stream, &buf, &buf_len, NULL)))
|
||||
while ((len = es_read_line (stream, &buf, &buf_len, NULL)) > 0)
|
||||
{
|
||||
char *p;
|
||||
if (errlinep)
|
||||
@ -735,6 +735,11 @@ do_nvc_parse (nvc_t *result, int *errlinep, estream_t stream,
|
||||
goto leave;
|
||||
}
|
||||
}
|
||||
if (len < 0)
|
||||
{
|
||||
err = gpg_error_from_syserror ();
|
||||
goto leave;
|
||||
}
|
||||
|
||||
/* Add the final entry. */
|
||||
if (raw_value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user