Commit 5347997
committed
kpartx: fix segfault when operating on regular files
The following problem has been introduced in multipath-tools 0.14.0:
> truncate -s1G /tmp/img
> kpartx -a /tmp/img
double free or corruption (out)
Aborted (core dumped) kpartx -a /tmp/img
Fix it by always allocating "uuid" on the heap, rather than
using a static char array.
Fixes: 8c39e60 ("kpartx: fix some memory leaks")
Fixes: opensvc#139
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>1 parent 6739b16 commit 5347997
2 files changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
| |||
0 commit comments