Commit 43192a0
BUG/MINOR: tools: fix possible null-deref in env_expand() on out-of-memory
In GH issue #2586 @Bbulatov reported a theoretical null-deref in
env_expand() in case there's no memory anymore to expand an environment
variable. The function should return NULL in this case so that the only
caller (str2sa_range) sees it. In practice it may only happen during
boot thus is harmless but better fix it since it's easy. This can be
backported to all versions where this applies.
(cherry picked from commit ba958fb)
Signed-off-by: Amaury Denoyelle <[email protected]>1 parent 995bba7 commit 43192a0
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4627 | 4627 | | |
4628 | 4628 | | |
4629 | 4629 | | |
4630 | | - | |
4631 | | - | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
4632 | 4633 | | |
4633 | 4634 | | |
4634 | 4635 | | |
| |||
4683 | 4684 | | |
4684 | 4685 | | |
4685 | 4686 | | |
| 4687 | + | |
| 4688 | + | |
| 4689 | + | |
4686 | 4690 | | |
4687 | 4691 | | |
4688 | 4692 | | |
| |||
4697 | 4701 | | |
4698 | 4702 | | |
4699 | 4703 | | |
| 4704 | + | |
4700 | 4705 | | |
4701 | 4706 | | |
4702 | 4707 | | |
| |||
0 commit comments