Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
aac926c5
...
aac926c581daf3fde3f62ac32e3a0036496442af
authored
2002-07-26 11:18:50 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(bodystructure,send_parameter_list): Fixed possible NULL dereference.
1 parent
e4c498af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
26 deletions
imap4d/fetch.c
imap4d/fetch.c
View file @
aac926c
...
...
@@ -815,36 +815,39 @@ bodystructure (message_t msg, int extension)
}
while
(
sp
!=
NULL
&&
*
sp
&&
isspace
((
unsigned
)
*
sp
))
sp
++
;
/* body parameter parenthesized list: Content-type attributes */
if
((
sp
!=
NULL
&&
*
sp
)
||
text_plain
)
{
int
space
=
0
;
int
have_charset
=
0
;
util_send
(
" ("
);
{
int
space
=
0
;
int
have_charset
=
0
;
/* Content-type parameter list. */
while
((
s
=
strtok_r
(
NULL
,
"
\t\r\n
;"
,
&
sp
)))
{
char
*
p
=
strchr
(
s
,
'='
);
if
(
p
)
*
p
++
=
'\0'
;
if
(
space
)
if
(
sp
)
{
/* Content-type parameter list. */
while
((
s
=
strtok_r
(
NULL
,
"
\t\r\n
;"
,
&
sp
)))
{
char
*
p
=
strchr
(
s
,
'='
);
if
(
p
)
*
p
++
=
'\0'
;
if
(
space
)
util_send
(
" "
);
util_send_qstring
(
s
);
util_send
(
" "
);
util_send_qstring
(
s
);
util_unquote
(
&
p
);
if
(
strcasecmp
(
s
,
"charset"
)
==
0
)
have_charset
=
1
;
util_send_qstring
(
p
);
space
=
1
;
}
}
if
(
!
have_charset
&&
text_plain
)
{
if
(
space
)
util_send
(
" "
);
util_unquote
(
&
p
);
if
(
strcasecmp
(
s
,
"charset"
)
==
0
)
have_charset
=
1
;
util_send_qstring
(
p
);
space
=
1
;
}
if
(
!
have_charset
&&
text_plain
)
{
if
(
space
)
util_send
(
" "
);
util_send
(
"
\"
CHARSET
\"
\"
US-ASCII
\"
"
);
}
}
util_send
(
"
\"
CHARSET
\"
\"
US-ASCII
\"
"
);
}
util_send
(
")"
);
}
else
...
...
@@ -1461,8 +1464,10 @@ fetch_send_address (char *addr)
static
int
send_parameter_list
(
char
*
buffer
)
{
while
(
*
buffer
&&
isspace
((
unsigned
)
*
buffer
))
buffer
++
;
if
(
*
buffer
)
if
(
buffer
)
while
(
*
buffer
&&
isspace
((
unsigned
)
*
buffer
))
buffer
++
;
if
(
buffer
&&
*
buffer
)
{
char
*
sp
=
NULL
;
char
*
s
;
...
...
Please
register
or
sign in
to post a comment