aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-02-03 13:00:06 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-02-03 13:00:06 +0100
commit5f7c82b32f548b5a1d6a4186630e8ef496a9d5e6 (patch)
treeae428320fbd98b457b8feef655947cbb753a93f8
parentb6871c1965af0eb87123e13f5d81ec0c9b801b71 (diff)
downloadbusybox-w32-5f7c82b32f548b5a1d6a4186630e8ef496a9d5e6.tar.gz
busybox-w32-5f7c82b32f548b5a1d6a4186630e8ef496a9d5e6.tar.bz2
busybox-w32-5f7c82b32f548b5a1d6a4186630e8ef496a9d5e6.zip
ash: add INT_OFF/ON around allocations
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 6be3ec600..983f7b108 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12686,7 +12686,7 @@ dotcmd(int argc_ UNUSED_PARAM, char **argv_ UNUSED_PARAM)
12686 fullname = find_dot_file(argv[0]); 12686 fullname = find_dot_file(argv[0]);
12687 argv++; 12687 argv++;
12688 args_need_save = argv[0]; 12688 args_need_save = argv[0];
12689 if (args_need_save) { /* . FILE ARGS, ARGS exist */ 12689 if (args_need_save) { /* ". FILE ARGS", and ARGS are not empty */
12690 int argc; 12690 int argc;
12691 saveparam = shellparam; 12691 saveparam = shellparam;
12692 shellparam.malloced = 0; 12692 shellparam.malloced = 0;
@@ -13480,7 +13480,7 @@ procargs(char **argv)
13480#if DEBUG == 2 13480#if DEBUG == 2
13481 debug = 1; 13481 debug = 1;
13482#endif 13482#endif
13483 /* POSIX 1003.2: first arg after -c cmd is $0, remainder $1... */ 13483 /* POSIX 1003.2: first arg after "-c CMD" is $0, remainder $1... */
13484 if (xminusc) { 13484 if (xminusc) {
13485 minusc = *xargv++; 13485 minusc = *xargv++;
13486 if (*xargv) 13486 if (*xargv)
@@ -13661,9 +13661,11 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
13661 if (!hp) { 13661 if (!hp) {
13662 hp = lookupvar("HOME"); 13662 hp = lookupvar("HOME");
13663 if (hp) { 13663 if (hp) {
13664 INT_OFF;
13664 hp = concat_path_file(hp, ".ash_history"); 13665 hp = concat_path_file(hp, ".ash_history");
13665 setvar0("HISTFILE", hp); 13666 setvar0("HISTFILE", hp);
13666 free((char*)hp); 13667 free((char*)hp);
13668 INT_ON;
13667 hp = lookupvar("HISTFILE"); 13669 hp = lookupvar("HISTFILE");
13668 } 13670 }
13669 } 13671 }