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

Commit 4ffe01b7 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Prevent out of bound access while getting build mask"

parents a6a726d4 d8d06dcf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -633,7 +633,8 @@ static int diag_cmd_get_build_mask(unsigned char *src_buf, int src_len,
	struct diag_build_mask_req_t *req = NULL;
	struct diag_msg_build_mask_t rsp;

	if (!src_buf || !dest_buf || src_len <= 0 || dest_len <= 0) {
	if (!src_buf || !dest_buf || src_len <= 0 || dest_len <= 0 ||
		src_len < sizeof(struct diag_build_mask_req_t)) {
		pr_err("diag: Invalid input in %s, src_buf: %pK, src_len: %d, dest_buf: %pK, dest_len: %d\n",
		       __func__, src_buf, src_len, dest_buf, dest_len);
		return -EINVAL;