mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(rm): Put two local variables in static storage,
so they can't be clobbered by the potential longjmp.
This commit is contained in:
1 parent
a32544a77f
commit
5151ce79b2
1 file changed
+5
-2
+5
-2
@@ -1111,10 +1111,13 @@ enum RM_status
|
||||
rm (size_t n_files, char const *const *file, struct rm_options const *x)
|
||||
{
|
||||
struct saved_cwd *cwd_state = NULL;
|
||||
enum RM_status status = RM_OK;
|
||||
size_t i;
|
||||
Dirstack_state *ds;
|
||||
|
||||
/* Put the following two variables in static storage, so they can't
|
||||
be clobbered by the potential longjmp into this function. */
|
||||
static enum RM_status status = RM_OK;
|
||||
static size_t i;
|
||||
|
||||
ds = ds_init ();
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
|
||||
Reference in new issue
Block a user