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:
Jack Henschel 2017-03-24 23:08:10 +01:00
parent 6b95b59090
commit 5a31dab643

View file

@ -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);