diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-01-17 13:34:33 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-01-17 16:43:06 +0100 |
commit | 7eac791dae06f3cdf8a00bd10c2ec6269983c053 (patch) | |
tree | 48e9096e6cd6c99cdee378394e88259c4fb2191d | |
parent | d73ea7efd81c0744d0886f6524a2ac5ec7236870 (diff) | |
download | gnutls-7eac791dae06f3cdf8a00bd10c2ec6269983c053.tar.gz |
opencdk: improved error code checking in the stream reading functions
This ammends 49be4f7b82eba2363bb8d4090950dad976a77a3a
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/opencdk/read-packet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c index fa4c604d81..8055a63ed5 100644 --- a/lib/opencdk/read-packet.c +++ b/lib/opencdk/read-packet.c @@ -917,11 +917,12 @@ read_new_length(cdk_stream_t inp, (*r_size)++; *r_len = ((c - 192) << 8) + c1 + 192; } else if (c == 255) { - *r_len = read_32(inp); - if (*r_len == (u32)-1) { + c1 = read_32(inp); + if (c1 == (u32)-1) { return; } + *r_len = c1; (*r_size) += 4; } else { *r_len = 1 << (c & 0x1f); |