From 3dfcde4a8282dff0956e415429936d86b0833fe6 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 1 May 2015 12:47:03 +1000 Subject: [PATCH 1/2] Add sanity check to prevent trying to malloc more ram than a system/environment is capable of --- stream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stream.c b/stream.c index c2784ed..2af80a4 100644 --- a/stream.c +++ b/stream.c @@ -1624,6 +1624,8 @@ fill_another: sinfo->total_read += padded_len; fsync(control->fd_out); + if (unlikely(u_len > control->maxram)) + fatal_return(("Unable to malloc buffer of size %lld in this environment\n", u_len), -1); s_buf = malloc(MAX(u_len, MIN_SIZE)); if (unlikely(u_len && !s_buf)) fatal_return(("Unable to malloc buffer of size %lld in fill_buffer\n", u_len), -1); From bbb3058cc34cd599fd2f14cf41a03c77b20605f7 Mon Sep 17 00:00:00 2001 From: George Makrydakis Date: Wed, 6 May 2015 00:55:19 +0300 Subject: [PATCH 2/2] A whitespace fix on lrztar. Signed-off-by: ckolivas --- lrztar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lrztar b/lrztar index d2861ad..e773fe2 100755 --- a/lrztar +++ b/lrztar @@ -138,7 +138,7 @@ Notice: "$i/${s##*/}.tar.${vopt[v_S]}" return 1 } - tar c "$s" | lrzip ${p[@]// /\\ } + tar c "$s" | lrzip "${p[@]}" x=$? } return $x