Commit b06cf01
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: #139
Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>1 parent c916c89 commit b06cf01
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 | | |
| |||
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
| |||
| 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