aboutsummaryrefslogtreecommitdiff
path: root/miscutils/bbconfig.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-04-09 08:50:34 +0100
committerRon Yorston <rmy@pobox.com>2018-04-09 08:50:34 +0100
commit921c1ab66bad54d4ad8591bb74e41ac985248496 (patch)
tree552a04c691e78e78570e4ec2c83fbc0e59953924 /miscutils/bbconfig.c
parent5b6f06f5eb8628955262508d153627fe6f2d1c8b (diff)
parenta1870f4807a75663a085c9f5e92870fa7554f0ad (diff)
downloadbusybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.tar.gz
busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.tar.bz2
busybox-w32-921c1ab66bad54d4ad8591bb74e41ac985248496.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'miscutils/bbconfig.c')
-rw-r--r--miscutils/bbconfig.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c
index 2151c622c..aa42de648 100644
--- a/miscutils/bbconfig.c
+++ b/miscutils/bbconfig.c
@@ -45,13 +45,22 @@ int bbconfig_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
45{ 45{
46#if ENABLE_FEATURE_COMPRESS_BBCONFIG 46#if ENABLE_FEATURE_COMPRESS_BBCONFIG
47 bunzip_data *bd; 47 bunzip_data *bd;
48 int i = start_bunzip(&bd, 48 int i;
49 jmp_buf jmpbuf;
50
51 /* Setup for I/O error handling via longjmp */
52 i = setjmp(jmpbuf);
53 if (i == 0) {
54 i = start_bunzip(&jmpbuf,
55 &bd,
49 /* src_fd: */ -1, 56 /* src_fd: */ -1,
50 /* inbuf: */ bbconfig_config_bz2, 57 /* inbuf: */ bbconfig_config_bz2,
51 /* len: */ sizeof(bbconfig_config_bz2)); 58 /* len: */ sizeof(bbconfig_config_bz2)
52 /* read_bunzip can longjmp to start_bunzip, and ultimately 59 );
53 * end up here with i != 0 on read data errors! Not trivial */ 60 }
54 if (!i) { 61 /* read_bunzip can longjmp and end up here with i != 0
62 * on read data errors! Not trivial */
63 if (i == 0) {
55 /* Cannot use xmalloc: will leak bd in NOFORK case! */ 64 /* Cannot use xmalloc: will leak bd in NOFORK case! */
56 char *outbuf = malloc_or_warn(sizeof(bbconfig_config)); 65 char *outbuf = malloc_or_warn(sizeof(bbconfig_config));
57 if (outbuf) { 66 if (outbuf) {