Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
ad86d5ba
Commit
ad86d5ba
authored
Oct 01, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential buffer overflow in build_pt_list_cb
Spotted by: Coverity
parent
00762b59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
varnishstat_curses.c
bin/varnishstat/varnishstat_curses.c
+7
-6
No files found.
bin/varnishstat/varnishstat_curses.c
View file @
ad86d5ba
...
...
@@ -258,6 +258,7 @@ build_pt_list_cb(void *priv, const struct VSC_point *vpt)
struct
pt_priv
*
pt_priv
;
struct
pt
*
pt
;
char
buf
[
128
];
size_t
l
;
if
(
vpt
==
NULL
)
return
(
0
);
...
...
@@ -290,16 +291,17 @@ build_pt_list_cb(void *priv, const struct VSC_point *vpt)
pt
->
key
=
strdup
(
buf
);
AN
(
pt
->
key
);
l
=
sizeof
buf
;
*
buf
=
'\0'
;
if
(
strcmp
(
vpt
->
section
->
type
,
""
))
{
str
cat
(
buf
,
vpt
->
section
->
type
);
str
cat
(
buf
,
"."
);
str
ncat
(
buf
,
vpt
->
section
->
type
,
sizeof
buf
-
strlen
(
buf
)
-
1
);
str
ncat
(
buf
,
"."
,
sizeof
buf
-
strlen
(
buf
)
-
1
);
}
if
(
strcmp
(
vpt
->
section
->
ident
,
""
))
{
str
cat
(
buf
,
vpt
->
section
->
ident
);
str
cat
(
buf
,
"."
);
str
ncat
(
buf
,
vpt
->
section
->
ident
,
sizeof
buf
-
strlen
(
buf
)
-
1
);
str
ncat
(
buf
,
"."
,
sizeof
buf
-
strlen
(
buf
)
-
1
);
}
str
cat
(
buf
,
vpt
->
desc
->
name
);
str
ncat
(
buf
,
vpt
->
desc
->
name
,
sizeof
buf
-
strlen
(
buf
)
-
1
);
pt
->
name
=
strdup
(
buf
);
AN
(
pt
->
name
);
...
...
@@ -667,7 +669,6 @@ draw_line_bitmap(WINDOW *w, int y, int x, int X, struct pt *pt)
}
break
;
default:
x
+=
COLW
;
break
;
}
col
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment