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 2/2] libxc: always set a error return code on lz4 decompression failures
Date: Fri, 8 Nov 2013 13:26:30 +1300 [thread overview]
Message-ID: <1383870390-9273-2-git-send-email-mattjd@gmail.com> (raw)
In-Reply-To: <1383870390-9273-1-git-send-email-mattjd@gmail.com>
While at it, rename the exit_2 label to exit_1; there is no exit_1
currently.
Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
tools/libxc/xc_dom_decompress_lz4.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c
index 4787535..b980186 100644
--- a/tools/libxc/xc_dom_decompress_lz4.c
+++ b/tools/libxc/xc_dom_decompress_lz4.c
@@ -69,13 +69,14 @@ int xc_try_lz4_decode(
size -= 4;
} else {
msg = "invalid header";
- goto exit_2;
+ goto exit_1;
}
for (;;) {
if (size < 4) {
msg = "missing data";
- goto exit_2;
+ ret = -1;
+ goto exit_1;
}
chunksize = get_unaligned_le32(inp);
if (chunksize == ARCHIVE_MAGICNUMBER) {
@@ -87,7 +88,8 @@ int xc_try_lz4_decode(
size -= 4;
if (chunksize > size) {
msg = "insufficient input data";
- goto exit_2;
+ ret = -1;
+ goto exit_1;
}
dest_len = out_len - (outp - output);
@@ -95,7 +97,7 @@ int xc_try_lz4_decode(
&dest_len);
if (ret < 0) {
msg = "decoding failed";
- goto exit_2;
+ goto exit_1;
}
outp += dest_len;
@@ -110,13 +112,14 @@ int xc_try_lz4_decode(
if (size < 0) {
msg = "data corrupted";
- goto exit_2;
+ ret = -1;
+ goto exit_1;
}
inp += chunksize;
}
-exit_2:
+exit_1:
free(output);
exit_0:
DOMPRINTF("LZ4 decompression error: %s\n", msg);
--
1.7.10.4
next prev parent 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 [PATCH 1/2] xen: always set an error return code on lz4 decompression failures Matthew Daley
2013-11-08 0:26 ` Matthew Daley [this message]
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-2-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).