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

added feature to extract filename from http attachment #2037

Merged
merged 9 commits into from
Jul 11, 2023

Conversation

ChiaraMaggi
Copy link
Contributor

No description provided.

Copy link
Collaborator

@IvanNardi IvanNardi left a 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 running make check in your machine

Some other comments below:

src/lib/protocols/http.c Outdated Show resolved Hide resolved
src/lib/protocols/http.c Outdated Show resolved Hide resolved
src/lib/protocols/http.c Outdated Show resolved Hide resolved
src/lib/protocols/http.c Outdated Show resolved Hide resolved
Copy link
Collaborator

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

src/lib/protocols/http.c Outdated Show resolved Hide resolved
src/lib/protocols/http.c Show resolved Hide resolved
src/lib/protocols/http.c Outdated Show resolved Hide resolved
src/lib/protocols/http.c Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@IvanNardi IvanNardi requested a review from lucaderi July 11, 2023 18:22
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);
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

Assignment not necessary

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.

3 participants