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

formparse: remove access to private data #3533

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@bagder
Copy link
Member

commented Feb 6, 2019

The mime.h (and strcase.h) include files are not meant to be included by
the command line tool.

Fixes #3532

@bagder bagder requested a review from monnerat Feb 6, 2019

@monnerat
Copy link
Collaborator

left a comment

This won't work for more than a single mime nesting level: although sufficient for form-data, this won't fully support SMTP mime mail properly.
In addition, trying to add a 2nd nesting level will probably (try to) corrupt the tree structure.
Instead, we might:

  • Implement an explicit parent stack
  • Rewrite the code to use a recursive procedure (for each nesting level), Update: this cannot be done since each arg is processed by a different call.
  • Implement a public API to get the parent mime.
@bagder

This comment has been minimized.

Copy link
Member Author

commented Feb 6, 2019

I would prefer to avoid adding another API call.

We could also just allow for N (let's say 5?) levels of nesting and use an array to store the parents in.

I've also noticed that tool_setopt.c also includes and uses data from the mime.h header so the fix needs more than this.

formparse: remove access to private data
The mime.h include file MUST NOT be included by the command line tool
code.

Fixes #3532

@bagder bagder force-pushed the bagder/curl-mimeparent branch from 31463fa to 9472727 Feb 6, 2019

rewrote the approach to store up to five parents

@bagder

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2019

@monnerat how about this updated take then?

@bagder

This comment has been minimized.

Copy link
Member Author

commented Feb 11, 2019

Made redundant by #3546 that already landed.

@bagder bagder closed this Feb 11, 2019

@bagder bagder deleted the bagder/curl-mimeparent branch Feb 11, 2019

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.