From: Matthew Daley <mattjd@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Matthew Daley <mattjd@gmail.com>,
Ian Campbell <ian.campbell@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 1/2] xen: always set an error return code on lz4 decompression failures
Date: Fri, 8 Nov 2013 13:26:29 +1300 [thread overview]
Message-ID: <1383870390-9273-1-git-send-email-mattjd@gmail.com> (raw)
Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
xen/common/unlz4.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/xen/common/unlz4.c b/xen/common/unlz4.c
index 195d829..ae87f4c 100644
--- a/xen/common/unlz4.c
+++ b/xen/common/unlz4.c
@@ -112,6 +112,7 @@ STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
if (fill) {
if (chunksize > lz4_compressbound(uncomp_chunksize)) {
error("chunk length is longer than allocated");
+ ret = -1;
goto exit_2;
}
fill(inp, chunksize);
@@ -133,8 +134,10 @@ STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
goto exit_2;
}
- if (flush && flush(outp, dest_len) != dest_len)
+ if (flush && flush(outp, dest_len) != dest_len) {
+ ret = -1;
goto exit_2;
+ }
if (output)
outp += dest_len;
if (posp)
@@ -146,6 +149,7 @@ STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
break;
else if (size < 0) {
error("data corrupted");
+ ret = -1;
goto exit_2;
}
--
1.7.10.4
next reply other threads:[~2013-11-08 0:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 0:26 Matthew Daley [this message]
2013-11-08 0:26 ` [PATCH 2/2] libxc: always set a error return code on lz4 decompression failures Matthew Daley
2014-01-24 8:01 ` [PATCH] libxc/unlz4: always set an error return code on failures Jan Beulich
2014-01-24 9:22 ` Ian Campbell
2014-01-28 11:49 ` Ian Campbell
2014-01-28 12:30 ` Jan Beulich
2014-01-28 12:32 ` Ian Campbell
2013-11-08 9:29 ` [PATCH 1/2] xen: always set an error return code on lz4 decompression failures Jan Beulich
2014-01-24 8:00 ` [PATCH] xen/unlz4: always set an error return code on failures Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383870390-9273-1-git-send-email-mattjd@gmail.com \
--to=mattjd@gmail.com \
--cc=JBeulich@suse.com \
--cc=ian.campbell@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).