-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add check that string read is not more than max length #328
Add check that string read is not more than max length #328
Conversation
@Hadatko as you can see, the compilation failed due to point 1 I mentioned in Additional context, can you help me and fix my commit? I don't know how to do it |
BTW, the fix is based on the decodeBinaryType template |
Ok thank you. I will take a look into this. |
I added fix to client side, and added the checks also in the read/write binary (was exist just in server write binary). |
2b94a4e
to
f1c4a23
Compare
25022d7
to
fb67a4f
Compare
fb67a4f
to
05da618
Compare
Hi @Hadatko , |
Can you fix the test too? Remove line, add line. |
@Hadatko can you point me in which tests the YML failed? |
b27c58a
to
c3a2b14
Compare
@Hadatko I done (hopefully) |
@Hadatko @MichalPrincNXP can you prioritize this PR to version 1.10.0? |
@amgross I put note here. Likely we do not manage to get it into 1.10.0 but into 1.11.0 it shouldn't be an issue. On develop branch it will be present once @MichalPrincNXP will have time, but we need to make decision on note i added. |
@Hadatko what is the note you are referring to? |
@Hadatko You probably didn't submitted your review, see at: github documentation that "Before you submit your review, your line comments are pending and only visible to you". |
About the asserts:
So when we should use assert:
Good example for it is the assert that currently exist, if erpc allocated the memory buffer and afterward got bigger length from the function that used this pointer, probably this function smashed the heap and have a bug so we should halt/reset the system. |
From my point of view asserts are good to replace conditions in release target (if you would write if condition it is present in DEBUG and in RELEASE target. Using assert is only in DEBUG target and halts system). |
@amgross Just few minor changes and it is ready for merge. |
@Hadatko , I think I did now what you asked |
@MichalPrincNXP any comments? |
@amgross i think @MichalPrincNXP will be available in beginning of new year. This is not critical bug so it will be likely added to next release as current one is in feature freeze state. |
OK, I will wait, |
@amgross Thank you for your patience |
Pull request
Choose Correct
Describe the pull request
Add fix to #326 , when passing string with max length set, ensure the real length not exceeds max length
To Reproduce
Run erpcgen on:
example.erpc.txt
Expected behavior
Screenshots
Desktop (please complete the following information):
Steps you didn't forgot to do
Additional context
I made just partially fix, need help for continue. What missing:
{% if info.stringAllocSize != info.stringLocalName + "_len" %}
is not working, don't know how to make it working