diff options
| author | Paul Eggert | 2019-04-19 12:55:18 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-19 12:57:30 -0700 |
| commit | 0f8628490e3e06f2bfe14451626f55b2165d711c (patch) | |
| tree | e0df0f09d9082c6911fa01a659234509ea1637d0 /src | |
| parent | bc4ed68314e51d784c03a06385f294db80f9a3bd (diff) | |
| download | emacs-0f8628490e3e06f2bfe14451626f55b2165d711c.tar.gz emacs-0f8628490e3e06f2bfe14451626f55b2165d711c.zip | |
Fix Fload dangling pointer
* src/lread.c (Fload): Expand decl’s lifetime to match its use.
Bug found by gcc -fsanitize=address.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index f83db2ac9f9..6cd1029cd9f 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1439,6 +1439,10 @@ Return t if the file exists and loads successfully. */) | |||
| 1439 | specbind (Qinhibit_file_name_operation, Qnil); | 1439 | specbind (Qinhibit_file_name_operation, Qnil); |
| 1440 | specbind (Qload_in_progress, Qt); | 1440 | specbind (Qload_in_progress, Qt); |
| 1441 | 1441 | ||
| 1442 | /* Declare here rather than inside the else-part because the storage | ||
| 1443 | might be accessed by the unbind_to call below. */ | ||
| 1444 | struct infile input; | ||
| 1445 | |||
| 1442 | if (is_module) | 1446 | if (is_module) |
| 1443 | { | 1447 | { |
| 1444 | #ifdef HAVE_MODULES | 1448 | #ifdef HAVE_MODULES |
| @@ -1453,7 +1457,6 @@ Return t if the file exists and loads successfully. */) | |||
| 1453 | } | 1457 | } |
| 1454 | else | 1458 | else |
| 1455 | { | 1459 | { |
| 1456 | struct infile input; | ||
| 1457 | input.stream = stream; | 1460 | input.stream = stream; |
| 1458 | input.lookahead = 0; | 1461 | input.lookahead = 0; |
| 1459 | infile = &input; | 1462 | infile = &input; |