Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
50bff12a
Commit
50bff12a
authored
9 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
imap: Fixed double quote in LIST command when mailbox contains spaces
parent
1a614c6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/imap.c
+8
-8
8 additions, 8 deletions
lib/imap.c
with
8 additions
and
8 deletions
lib/imap.c
+
8
−
8
View file @
50bff12a
...
...
@@ -98,7 +98,7 @@ static int imap_getsock(struct connectdata *conn, curl_socket_t *socks,
int
numsocks
);
static
CURLcode
imap_doing
(
struct
connectdata
*
conn
,
bool
*
dophase_done
);
static
CURLcode
imap_setup_connection
(
struct
connectdata
*
conn
);
static
char
*
imap_atom
(
const
char
*
str
);
static
char
*
imap_atom
(
const
char
*
str
,
bool
escape_only
);
static
CURLcode
imap_sendf
(
struct
connectdata
*
conn
,
const
char
*
fmt
,
...);
static
CURLcode
imap_parse_url_options
(
struct
connectdata
*
conn
);
static
CURLcode
imap_parse_url_path
(
struct
connectdata
*
conn
);
...
...
@@ -540,8 +540,8 @@ static CURLcode imap_perform_login(struct connectdata *conn)
}
/* Make sure the username and password are in the correct atom format */
user
=
imap_atom
(
conn
->
user
);
passwd
=
imap_atom
(
conn
->
passwd
);
user
=
imap_atom
(
conn
->
user
,
false
);
passwd
=
imap_atom
(
conn
->
passwd
,
false
);
/* Send the LOGIN command */
result
=
imap_sendf
(
conn
,
"LOGIN %s %s"
,
user
?
user
:
""
,
...
...
@@ -654,7 +654,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
imap
->
custom_params
?
imap
->
custom_params
:
""
);
else
{
/* Make sure the mailbox is in the correct atom format if necessary */
mailbox
=
imap
->
mailbox
?
imap_atom
(
imap
->
mailbox
)
:
(
char
*
)
""
;
mailbox
=
imap
->
mailbox
?
imap_atom
(
imap
->
mailbox
,
true
)
:
(
char
*
)
""
;
if
(
!
mailbox
)
return
CURLE_OUT_OF_MEMORY
;
...
...
@@ -695,7 +695,7 @@ static CURLcode imap_perform_select(struct connectdata *conn)
}
/* Make sure the mailbox is in the correct atom format */
mailbox
=
imap_atom
(
imap
->
mailbox
);
mailbox
=
imap_atom
(
imap
->
mailbox
,
false
);
if
(
!
mailbox
)
return
CURLE_OUT_OF_MEMORY
;
...
...
@@ -769,7 +769,7 @@ static CURLcode imap_perform_append(struct connectdata *conn)
}
/* Make sure the mailbox is in the correct atom format */
mailbox
=
imap_atom
(
imap
->
mailbox
);
mailbox
=
imap_atom
(
imap
->
mailbox
,
false
);
if
(
!
mailbox
)
return
CURLE_OUT_OF_MEMORY
;
...
...
@@ -1815,7 +1815,7 @@ static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...)
* The returned string needs to be freed.
*
*/
static
char
*
imap_atom
(
const
char
*
str
)
static
char
*
imap_atom
(
const
char
*
str
,
bool
escape_only
)
{
const
char
*
p1
;
char
*
p2
;
...
...
@@ -1835,7 +1835,7 @@ static char *imap_atom(const char *str)
backsp_count
++
;
else
if
(
*
p1
==
'"'
)
quote_count
++
;
else
if
(
*
p1
==
' '
)
else
if
(
!
escape_only
&&
(
*
p1
==
' '
)
)
space_exists
=
TRUE
;
p1
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment