-
Notifications
You must be signed in to change notification settings - Fork 896
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
added feature to extract filename from http attachment #2037
Conversation
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.
Hi @ChiaraMaggi, thanks for your contribution.
Unfortunately, as you can see from the CI results, there are multiple issues...
Let's start try fixing the compilation
- in
src/include/ndpi_typedefs.h
replace 952 with 960. You can test it yourself runningmake check
in your machine
Some other comments below:
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.
Definitely better. Just some small issues
Kudos, SonarCloud Quality Gate passed! |
flow->http.filename = strncpy(flow->http.filename, (char*)packet->content_disposition_line.ptr+attachment_len, filename_len); | ||
flow->http.filename[filename_len] = '\0'; | ||
if(flow->http.filename != NULL){ | ||
flow->http.filename = strncpy(flow->http.filename, (char*)packet->content_disposition_line.ptr+attachment_len, filename_len); |
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.
Assignment not necessary
flow->http.filename[filename_len-2] = '\0'; | ||
flow->http.filename = ndpi_malloc(filename_len-1); | ||
if(flow->http.filename != NULL){ | ||
flow->http.filename = strncpy(flow->http.filename, (char*)packet->content_disposition_line.ptr+attachment_len+1, filename_len-2); |
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.
Assignment not necessary
flow->http.filename = strncpy(flow->http.filename, (char*)packet->content_disposition_line.ptr+attachment_len+1, filename_len-1); | ||
flow->http.filename[filename_len-1] = '\0'; | ||
if(flow->http.filename != NULL){ | ||
flow->http.filename = strncpy(flow->http.filename, (char*)packet->content_disposition_line.ptr+attachment_len+1, filename_len-1); |
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.
Assignment not necessary
No description provided.