projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
856ad5f
)
[bug #4297] The strlen mh-format function can crash if 'str' is null.
author
Glenn Burkhardt
<glenn@aoi.ultranet.com>
Tue, 30 Sep 2003 14:36:04 +0000
(14:36 +0000)
committer
Glenn Burkhardt
<glenn@aoi.ultranet.com>
Tue, 30 Sep 2003 14:36:04 +0000
(14:36 +0000)
sbr/fmt_scan.c
patch
|
blob
|
history
diff --git
a/sbr/fmt_scan.c
b/sbr/fmt_scan.c
index
0a2397b
..
4f79bf6
100644
(file)
--- a/
sbr/fmt_scan.c
+++ b/
sbr/fmt_scan.c
@@
-511,7
+511,10
@@
fmt_scan (struct format *format, char *scanl, int width, int *dat)
value = dat[fmt->f_value];
break;
case FT_LV_STRLEN:
- value = strlen(str);
+ if (str != NULL)
+ value = strlen(str);
+ else
+ value = 0;
break;
case FT_LV_CHAR_LEFT:
value = width - (cp - scanl);