-
Notifications
You must be signed in to change notification settings - Fork 25
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
Few fixes for string type input #136
Conversation
i recommend to introduce a new c_frontend api for this purpose, and also a new member in the class rather than changing existing prototype. This will benefit in 2 ways. 1) backward compatibility 2)not impacting any other existing functionality if this is in use for any other platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i recommend to introduce a new c_frontend api for this purpose, and also a new member in the class rather than changing existing prototype. This will benefit in 2 ways. 1) backward compatibility 2)not impacting any other existing functionality if this is in use for any other platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I agree with adding a new API instead. This breaks backward compatibility |
891fc4b
to
d4313d1
Compare
1. If the input string is mentioned as hex, take the hex representation otherwise take the input bytes and convert them to ASCII for further processing. 2. Pass the length of input bytes/string. Use this length to copy and process the string bytes. This will mitigate the risk of buffer overflows, memory corruption or information leakage and other string issues which might occur while processing string without knowning it's length. The fix will also enable to pass and have NULL char and other special chars as part of string. Signed-off-by: Ruchit Gupta <[email protected]>
d4313d1
to
3d68638
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If the input string is mentioned as hex, take the hex representation otherwise take the input bytes and convert them to ASCII for further processing.
Pass the length of input bytes/string. Use this length to copy and process the string bytes. This will mitigate the risk of buffer overflows, memory corruption or information leakage and other string issues which might occur while processing string without knowning it's length. The fix will also enable to pass and have NULL char and other special chars as part of string.