mirror of
https://github.com/vale981/yabar
synced 2025-03-05 09:31:39 -05:00
Add addtional error handling to ya_volume
Without this check the block segfaults when no internal_option_2 is provided
This commit is contained in:
parent
6b95b59090
commit
5a31dab643
1 changed files with 2 additions and 1 deletions
|
@ -560,7 +560,8 @@ void ya_int_volume(ya_block_t *blk) {
|
|||
} else {
|
||||
ya_block_error(blk, "internal-option1 (device) is mandatory");
|
||||
}
|
||||
if( strcmp(blk->internal->option[1], "mapped") == 0 )
|
||||
if( blk->internal->option[1] &&
|
||||
strcmp(blk->internal->option[1], "mapped") == 0 )
|
||||
mapped = true;
|
||||
if( blk->internal->option[2] ) {
|
||||
sscanf(blk->internal->option[2], "%s %s", on, off);
|
||||
|
|
Loading…
Add table
Reference in a new issue