diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2019-05-12 10:22:04 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2019-05-12 10:22:04 +0200 |
commit | 1a60b35aa34261f26b10b96864b44ded84fc4011 (patch) | |
tree | 57657809249d76ab9b2bb78a7f8a5b4cfb4342b5 /camlibs/ricoh | |
parent | a11a83b29c6b5755679a0a22ccd5f686c0c1a9d6 (diff) | |
download | libgphoto2-1a60b35aa34261f26b10b96864b44ded84fc4011.tar.gz |
avoid nevative reads (AFL)
Diffstat (limited to 'camlibs/ricoh')
-rw-r--r-- | camlibs/ricoh/g3.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/camlibs/ricoh/g3.c b/camlibs/ricoh/g3.c index 073cb8edf..af37467d8 100644 --- a/camlibs/ricoh/g3.c +++ b/camlibs/ricoh/g3.c @@ -89,6 +89,8 @@ g3_channel_read(GPPort *port, int *channel, char **buffer, unsigned int *len) int toread = 0x800; if (toread + curlen > *len + 1 + 0x800) toread = *len + 1 + 0x800 - curlen; + if (toread <= 0) + break; ret = gp_port_read(port, *buffer + curlen, toread); if (ret < GP_OK) { |