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
8103ce9e
...
8103ce9ec3b9ddba5dc82348982d3e7a4a5b1db9
authored
2003-09-01 22:35:13 +0000
by
Wojciech Polak
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Check return code from msgset_parse to prevent segmentation fault.
1 parent
ec05f285
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
mail/next.c
mail/previous.c
mail/next.c
View file @
8103ce9
...
...
@@ -49,11 +49,19 @@ mail_next (int argc, char **argv)
else
{
msgset_t
*
list
=
NULL
;
msgset_parse
(
argc
,
argv
,
MSG_NODELETED
|
MSG_SILENT
,
&
list
);
n
=
list
->
msg_part
[
0
];
msgset_free
(
list
);
if
(
util_get_message
(
mbox
,
n
,
&
msg
))
return
1
;
int
rc
=
msgset_parse
(
argc
,
argv
,
MSG_NODELETED
|
MSG_SILENT
,
&
list
);
if
(
!
rc
)
{
n
=
list
->
msg_part
[
0
];
msgset_free
(
list
);
if
(
util_get_message
(
mbox
,
n
,
&
msg
))
return
1
;
}
else
{
util_error
(
_
(
"No applicable message"
));
return
1
;
}
}
cursor
=
n
;
util_do_command
(
"print"
);
...
...
mail/previous.c
View file @
8103ce9
...
...
@@ -49,11 +49,19 @@ mail_previous (int argc, char **argv)
else
{
msgset_t
*
list
=
NULL
;
msgset_parse
(
argc
,
argv
,
MSG_NODELETED
|
MSG_SILENT
,
&
list
);
n
=
list
->
msg_part
[
0
];
msgset_free
(
list
);
if
(
util_get_message
(
mbox
,
n
,
&
msg
))
return
1
;
int
rc
=
msgset_parse
(
argc
,
argv
,
MSG_NODELETED
|
MSG_SILENT
,
&
list
);
if
(
!
rc
)
{
n
=
list
->
msg_part
[
0
];
msgset_free
(
list
);
if
(
util_get_message
(
mbox
,
n
,
&
msg
))
return
1
;
}
else
{
util_error
(
_
(
"No applicable message"
));
return
1
;
}
}
cursor
=
n
;
util_do_command
(
"print"
);
...
...
Please
register
or
sign in
to post a comment