xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] xen: always set an error return code on lz4 decompression failures
@ 2013-11-08  0:26 Matthew Daley
  2013-11-08  0:26 ` [PATCH 2/2] libxc: always set a " Matthew Daley
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Matthew Daley @ 2013-11-08  0:26 UTC (permalink / raw)
  To: xen-devel; +Cc: Matthew Daley, Ian Campbell, Jan Beulich

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-28 12:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] libxc: always set a " 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

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).