adsprpc: Add check to prevent out of bound access
Add -ve value check for index to prevent the array out of bound access. Change-Id: I0d23e2cb258227ef76779d82ec2c8f6b9cf7f95f Signed-off-by: rnallago <quic_rnallago@quicinc.com>
This commit is contained in:
@@ -139,7 +139,7 @@ inline int verify_transport_device(int cid, int tvm_remote_domain)
|
||||
struct frpc_transport_session_control *session_control = NULL;
|
||||
|
||||
remote_domain = tvm_remote_domain;
|
||||
VERIFY(err, remote_domain < MAX_REMOTE_ID);
|
||||
VERIFY(err, remote_domain >= 0 && remote_domain < MAX_REMOTE_ID);
|
||||
if (err) {
|
||||
err = -ECHRNG;
|
||||
goto bail;
|
||||
@@ -393,7 +393,7 @@ int fastrpc_transport_send(int cid, void *rpc_msg, uint32_t rpc_msg_size, int tv
|
||||
struct kvec msg = {0};
|
||||
|
||||
remote_domain = tvm_remote_domain;
|
||||
VERIFY(err, remote_domain < MAX_REMOTE_ID);
|
||||
VERIFY(err, remote_domain >= 0 && remote_domain < MAX_REMOTE_ID);
|
||||
if (err) {
|
||||
err = -ECHRNG;
|
||||
goto bail;
|
||||
|
Reference in New Issue
Block a user