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

Few fixes for string type input #136

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

ruchitg
Copy link
Contributor

@ruchitg ruchitg commented Jul 17, 2024

  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.

@swaroopsarma
Copy link
Contributor

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

Copy link
Contributor

@swaroopsarma swaroopsarma left a 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

Copy link
Contributor

@satish153 satish153 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@saynb
Copy link
Collaborator

saynb commented Jul 18, 2024

I agree with adding a new API instead. This breaks backward compatibility

@swaroopsarma swaroopsarma requested a review from saynb July 18, 2024 14:46
@ruchitg ruchitg force-pushed the ruchit_tdi_string_fix_v1 branch from 891fc4b to d4313d1 Compare July 19, 2024 12:02
@swaroopsarma swaroopsarma self-requested a review July 19, 2024 14:42
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]>
@ruchitg ruchitg force-pushed the ruchit_tdi_string_fix_v1 branch from d4313d1 to 3d68638 Compare July 22, 2024 06:49
Copy link
Contributor

@swaroopsarma swaroopsarma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@swaroopsarma swaroopsarma merged commit 1abebdd into main Jul 22, 2024
1 check passed
@swaroopsarma swaroopsarma deleted the ruchit_tdi_string_fix_v1 branch July 22, 2024 06:54
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.

4 participants