Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35a37bc8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dm-req-crypt: check argc before access argv[5]"

parents 49a50a9e a262d0c3
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -916,13 +916,20 @@ static int req_crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
	}
	start_sector_orig = tmpll;

	/* Allow backward compatible */
	if (argc >= 6) {
		if (argv[5]) {
			if (!strcmp(argv[5], "fde_enabled"))
				is_fde_enabled = true;
			else
				is_fde_enabled = false;
		} else {
		DMERR(" %s Arg[5] invalid, set FDE eanbled.\n", __func__);
			DMERR(" %s Arg[5] invalid\n", __func__);
			err =  DM_REQ_CRYPT_ERROR;
			goto ctr_exit;
		}
	} else {
		DMERR(" %s Arg[5] missing, set FDE enabled.\n", __func__);
		is_fde_enabled = true; /* backward compatible */
	}