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
cd2fa07e
...
cd2fa07e24376a7c3b2c08213abb51e90ed0ca84
authored
2002-09-27 14:37:18 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(strobj_len,print_string): Extra safety not to dereference NULL pointer.
1 parent
c55a3ec8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
mh/mh_format.c
mh/mh_format.c
View file @
cd2fa07
...
...
@@ -66,7 +66,7 @@ strobj_free (strobj_t *obj)
}
#define strobj_ptr(p) ((p)->ptr ? (p)->ptr : "")
#define strobj_len(p)
strlen((p)->ptr
)
#define strobj_len(p)
(strobj_is_null(p) ? 0 : strlen((p)->ptr)
)
#define strobj_is_null(p) ((p)->ptr == NULL)
#define strobj_is_static(p) ((p)->size == 0)
...
...
@@ -167,8 +167,15 @@ compress_ws (char *str, size_t *size)
static
void
print_string
(
struct
mh_machine
*
mach
,
size_t
width
,
char
*
str
,
size_t
len
)
{
size_t
rest
=
strlen
(
str
)
;
size_t
rest
;
if
(
!
str
)
{
str
=
""
;
len
=
0
;
}
rest
=
strlen
(
str
);
if
(
len
>
rest
)
len
=
rest
;
if
(
!
width
)
...
...
@@ -864,9 +871,14 @@ _parse_date (struct mh_machine *mach, struct tm *tm, mu_timezone *tz)
if
(
parse822_date_time
(
&
p
,
date
+
strlen
(
date
),
tm
,
tz
))
{
mh_error
(
"can't parse date: [%s]"
,
date
);
return
-
1
;
time_t
t
;
/*mh_error ("can't parse date: [%s]", date);*/
time
(
&
t
);
*
tm
=
*
localtime
(
&
t
);
tz
->
utc_offset
=
mu_utc_offset
();
}
return
0
;
}
...
...
Please
register
or
sign in
to post a comment