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
acb3a8e2
...
acb3a8e2a9d76611d9cf2b099d95eab10c5f2189
authored
2002-07-23 21:14:22 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Properly check the return from headers_aget_value.
1 parent
f5b2407d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
27 deletions
imap4d/fetch.c
mail/followup.c
mail/reply.c
imap4d/fetch.c
View file @
acb3a8e
...
...
@@ -568,7 +568,7 @@ fetch_envelope0 (message_t msg)
/* Note that the server MUST default the reply-to and sender fields from
the From field; a client is not expected to know to do this. */
header_aget_value
(
header
,
"Sender"
,
&
buffer
);
fetch_send_address
(
(
*
buffer
==
'\0'
)
?
from
:
buffer
);
fetch_send_address
(
buffer
?
buffer
:
from
);
free
(
buffer
);
util_send
(
" "
);
...
...
@@ -576,7 +576,7 @@ fetch_envelope0 (message_t msg)
/* Note that the server MUST default the reply-to and sender fields from
the From field; a client is not expected to know to do this. */
header_aget_value
(
header
,
"Reply-to"
,
&
buffer
);
fetch_send_address
(
(
*
buffer
==
'\0'
)
?
from
:
buffer
);
fetch_send_address
(
buffer
?
buffer
:
from
);
free
(
buffer
);
util_send
(
" "
);
...
...
@@ -664,13 +664,15 @@ fetch_bodystructure0 (message_t message, int extension)
message_get_header
(
message
,
&
header
);
/* The subtype. */
header_aget_value
(
header
,
MU_HEADER_CONTENT_TYPE
,
&
buffer
);
s
=
strtok_r
(
buffer
,
"
\t\r\n
;"
,
&
sp
);
if
(
s
)
{
s
=
strchr
(
s
,
'/'
);
if
(
s
)
*
s
++
=
'\0'
;
if
(
header_aget_value
(
header
,
MU_HEADER_CONTENT_TYPE
,
&
buffer
)
==
0
)
{
s
=
strtok_r
(
buffer
,
"
\t\r\n
;"
,
&
sp
);
if
(
s
)
{
s
=
strchr
(
s
,
'/'
);
if
(
s
)
*
s
++
=
'\0'
;
}
}
util_send
(
" "
);
util_send_qstring
(
s
);
...
...
@@ -787,9 +789,8 @@ bodystructure (message_t msg, int extension)
/* body type: Content-Type
body subtype: */
header_aget_value
(
header
,
MU_HEADER_CONTENT_TYPE
,
&
buffer
);
s
=
strtok_r
(
buffer
,
"
\t\r\n
;"
,
&
sp
);
if
(
s
)
if
(
header_aget_value
(
header
,
MU_HEADER_CONTENT_TYPE
,
&
buffer
)
==
0
&&
(
s
=
strtok_r
(
buffer
,
"
\t\r\n
;"
,
&
sp
))
!=
NULL
)
{
char
*
p
=
strchr
(
s
,
'/'
);
if
(
strcasecmp
(
s
,
"MESSAGE/RFC822"
)
==
0
)
...
...
@@ -865,7 +866,7 @@ bodystructure (message_t msg, int extension)
/* body encoding: Content-Transfer-Encoding. */
header_aget_value
(
header
,
MU_HEADER_CONTENT_TRANSFER_ENCODING
,
&
buffer
);
util_send
(
" "
);
util_send_qstring
(
(
*
buffer
)
?
buffer
:
"7BIT"
);
util_send_qstring
(
buffer
?
buffer
:
"7BIT"
);
free
(
buffer
);
/* body size RFC822 format. */
...
...
@@ -1211,12 +1212,9 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start,
{
char
*
value
=
NULL
;
size_t
n
=
0
;
header_aget_value
(
header
,
array
[
j
],
&
value
);
if
(
*
value
==
'\0'
)
{
free
(
value
);
if
(
header_aget_value
(
header
,
array
[
j
],
&
value
))
continue
;
}
n
=
asprintf
(
&
buffer
,
"%s: %s
\n
"
,
array
[
j
],
value
);
status
=
stream_write
(
stream
,
buffer
,
n
,
off
,
&
n
);
off
+=
n
;
...
...
mail/followup.c
View file @
acb3a8e
...
...
@@ -46,10 +46,12 @@ mail_followup (int argc, char **argv)
/* Create subject value */
message_get_header
(
msg
,
&
hdr
);
header_aget_value
(
hdr
,
MU_HEADER_SUBJECT
,
&
str
);
util_strcat
(
&
env
.
subj
,
"Re: "
);
util_strcat
(
&
env
.
subj
,
str
);
free
(
str
);
if
(
header_aget_value
(
hdr
,
MU_HEADER_SUBJECT
,
&
str
)
==
0
)
{
util_strcat
(
&
env
.
subj
,
"Re: "
);
util_strcat
(
&
env
.
subj
,
str
);
free
(
str
);
}
/* Generate "to" list */
env
.
to
=
util_get_sender
(
cursor
,
0
);
...
...
mail/reply.c
View file @
acb3a8e
...
...
@@ -57,11 +57,12 @@ mail_reply(int argc, char **argv)
size_t
i
,
count
=
0
;
char
buf
[
512
];
header_aget_value
(
hdr
,
MU_HEADER_TO
,
&
str
);
address_create
(
&
addr
,
str
);
free
(
str
);
address_get_count
(
addr
,
&
count
);
if
(
header_aget_value
(
hdr
,
MU_HEADER_TO
,
&
str
)
==
0
)
{
address_create
(
&
addr
,
str
);
free
(
str
);
address_get_count
(
addr
,
&
count
);
}
/* Make sure we do not include our alternate names */
for
(
i
=
1
;
i
<=
count
;
i
++
)
...
...
Please
register
or
sign in
to post a comment