Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDKBDEV-3103:Reason for change: Implement validation for expression #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

viveksinghnarwaria
Copy link

When a dmcli query is made with a large number of dots, rtrouted crashes. For example: dmcli eRT getv Device.NAT.X_CISCO_COM_DMZ.InternalIP

The reason is that the tokenizeExpression function splits the datamodel path based on dots and writes into the workTokens array without checking the number of elements being written. This causes a buffer overflow if the number of dots is more than the size of the workTokens array (32). [Solution]
Adding expression validation at the time of routeAdd to safe return with Invalid Expression Error. Test Procedure: Sanity.
Risks: None.

Signed-off-by: Vivek Narwaria [email protected]

When a dmcli query is made with a large number of dots, rtrouted crashes. For example: dmcli eRT getv Device.NAT.X_CISCO_COM_DMZ.InternalIP

The reason is that the tokenizeExpression function splits the datamodel path based on dots and writes into the workTokens array without checking the number of elements being written.
This causes a buffer overflow if the number of dots is more than the size of the workTokens array (32).
[Solution]
Adding expression validation at the time of routeAdd to safe return with Invalid Expression Error.
Test Procedure: Sanity.
Risks: None.

Signed-off-by: Vivek Narwaria [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant