Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
d763ce00
Commit
d763ce00
authored
Dec 05, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tell FlexeLint to check printf-like arguments and fix what it found.
Prompted to by: DocWilco
parent
9cb9ba6f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
30 additions
and
20 deletions
+30
-20
flint.lnt
bin/flint.lnt
+3
-0
cache_ban.c
bin/varnishd/cache/cache_ban.c
+3
-3
cache_cli.c
bin/varnishd/cache/cache_cli.c
+1
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+2
-2
cache_http.c
bin/varnishd/cache/cache_http.c
+2
-2
cache_lck.c
bin/varnishd/cache/cache_lck.c
+1
-1
cache_panic.c
bin/varnishd/cache/cache_panic.c
+1
-1
cache_vary.c
bin/varnishd/cache/cache_vary.c
+2
-2
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+4
-3
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+1
-1
cache_wrw.c
bin/varnishd/cache/cache_wrw.c
+1
-1
flint.lnt
bin/varnishd/flint.lnt
+6
-0
vcc_compile.h
lib/libvcl/vcc_compile.h
+1
-1
vcc_token.c
lib/libvcl/vcc_token.c
+2
-2
No files found.
bin/flint.lnt
View file @
d763ce00
...
...
@@ -2,6 +2,9 @@
-ffc // No automatic custody
-printf(2, VSB_printf)
///////////////////////////////////////////////////////////////////////
// Weirdness relating to varnish includes etc.
...
...
bin/varnishd/cache/cache_ban.c
View file @
d763ce00
...
...
@@ -77,7 +77,7 @@ struct ban {
unsigned
magic
;
#define BAN_MAGIC 0x700b08ea
VTAILQ_ENTRY
(
ban
)
list
;
unsigned
refcount
;
int
refcount
;
unsigned
flags
;
#define BAN_F_GONE (1 << 0)
#define BAN_F_REQ (1 << 2)
...
...
@@ -841,7 +841,7 @@ ban_lurker_work(const struct sess *sp, unsigned pass)
break
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSL
(
SLT_Debug
,
0
,
"test: %p %
d %d
"
,
VSL
(
SLT_Debug
,
0
,
"test: %p %
u %u
"
,
oc
,
oc
->
flags
&
OC_F_LURK
,
pass
);
if
((
oc
->
flags
&
OC_F_LURK
)
==
pass
)
break
;
...
...
@@ -892,7 +892,7 @@ ban_lurker_work(const struct sess *sp, unsigned pass)
}
Lck_Unlock
(
&
oh
->
mtx
);
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSL
(
SLT_Debug
,
0
,
"lurker done: %p %
d %d
"
,
VSL
(
SLT_Debug
,
0
,
"lurker done: %p %
u %u
"
,
oc
,
oc
->
flags
&
OC_F_LURK
,
pass
);
(
void
)
HSH_Deref
(
sp
->
wrk
,
NULL
,
&
o
);
VTIM_sleep
(
cache_param
->
ban_lurker_sleep
);
...
...
bin/varnishd/cache/cache_cli.c
View file @
d763ce00
...
...
@@ -92,7 +92,7 @@ cli_cb_after(const struct cli *cli)
ASSERT_CLI
();
Lck_Unlock
(
&
cli_mtx
);
VSL
(
SLT_CLI
,
0
,
"Wr %03u %
u
%s"
,
VSL
(
SLT_CLI
,
0
,
"Wr %03u %
zd
%s"
,
cli
->
result
,
VSB_len
(
cli
->
sb
),
VSB_data
(
cli
->
sb
));
}
...
...
bin/varnishd/cache/cache_fetch.c
View file @
d763ce00
...
...
@@ -565,7 +565,7 @@ FetchBody(struct worker *w, struct object *obj)
w
->
busyobj
->
fetch_obj
=
NULL
;
WSLB
(
w
,
SLT_Fetch_Body
,
"%u(%s) cls %d mklen %
u
"
,
WSLB
(
w
,
SLT_Fetch_Body
,
"%u(%s) cls %d mklen %
d
"
,
w
->
busyobj
->
body_status
,
body_status
(
w
->
busyobj
->
body_status
),
cls
,
mklen
);
...
...
@@ -591,7 +591,7 @@ FetchBody(struct worker *w, struct object *obj)
if
(
cls
==
0
&&
w
->
busyobj
->
should_close
)
cls
=
1
;
WSLB
(
w
,
SLT_Length
,
"%
u
"
,
obj
->
len
);
WSLB
(
w
,
SLT_Length
,
"%
zd
"
,
obj
->
len
);
{
/* Sanity check fetch methods accounting */
...
...
bin/varnishd/cache/cache_http.c
View file @
d763ce00
...
...
@@ -520,7 +520,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, unsigned vsl_id, char *p,
if
(
q
-
p
>
htc
->
maxhdr
)
{
VSC_C_main
->
losthdr
++
;
WSL
(
w
,
SLT_LostHeader
,
vsl_id
,
"%.*s"
,
q
-
p
>
20
?
20
:
q
-
p
,
p
);
(
int
)(
q
-
p
>
20
?
20
:
q
-
p
)
,
p
);
return
(
413
);
}
...
...
@@ -546,7 +546,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, unsigned vsl_id, char *p,
}
else
{
VSC_C_main
->
losthdr
++
;
WSL
(
w
,
SLT_LostHeader
,
vsl_id
,
"%.*s"
,
q
-
p
>
20
?
20
:
q
-
p
,
p
);
(
int
)(
q
-
p
>
20
?
20
:
q
-
p
)
,
p
);
return
(
413
);
}
}
...
...
bin/varnishd/cache/cache_lck.c
View file @
d763ce00
...
...
@@ -114,7 +114,7 @@ Lck__Trylock(struct lock *lck, const char *p, const char *f, int l)
assert
(
r
==
0
||
r
==
EBUSY
);
if
(
cache_param
->
diag_bitmap
&
0x8
)
VSL
(
SLT_Debug
,
0
,
"MTX_TRYLOCK(%s,%s,%d,%s) = %d"
,
p
,
f
,
l
,
ilck
->
w
);
"MTX_TRYLOCK(%s,%s,%d,%s) = %d"
,
p
,
f
,
l
,
ilck
->
w
,
r
);
if
(
r
==
0
)
{
AZ
(
ilck
->
held
);
ilck
->
held
=
1
;
...
...
bin/varnishd/cache/cache_panic.c
View file @
d763ce00
...
...
@@ -234,7 +234,7 @@ pan_sess(const struct sess *sp)
VSB_printf
(
pan_vsp
,
"sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
" fd = %d, id = %
d
, xid = %u,
\n
"
,
" fd = %d, id = %
u
, xid = %u,
\n
"
,
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
,
sp
->
xid
);
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
sp
->
addr
?
sp
->
addr
:
"?.?.?.?"
,
...
...
bin/varnishd/cache/cache_vary.c
View file @
d763ce00
...
...
@@ -64,7 +64,7 @@ VRY_Create(const struct sess *sp, const struct http *hp)
{
char
*
v
,
*
p
,
*
q
,
*
h
,
*
e
;
struct
vsb
*
sb
,
*
sbh
;
int
l
;
unsigned
l
;
/* No Vary: header, no worries */
if
(
!
http_GetHdr
(
hp
,
H_Vary
,
&
v
))
...
...
@@ -109,7 +109,7 @@ VRY_Create(const struct sess *sp, const struct http *hp)
e
=
h
;
l
=
0xffff
;
}
VSB_printf
(
sb
,
"%c%c"
,
(
unsigned
)
l
>>
8
,
l
&
0xff
);
VSB_printf
(
sb
,
"%c%c"
,
(
int
)(
l
>>
8
),
(
int
)(
l
&
0xff
)
);
/* Append to vary matching string */
VSB_bcat
(
sb
,
VSB_data
(
sbh
),
VSB_len
(
sbh
));
if
(
e
!=
h
)
...
...
bin/varnishd/cache/cache_vrt.c
View file @
d763ce00
...
...
@@ -74,7 +74,7 @@ VRT_count(const struct sess *sp, unsigned u)
return
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
if
(
cache_param
->
vcl_trace
)
WSP
(
sp
,
SLT_VCL_trace
,
"%u %
d.%d
"
,
u
,
WSP
(
sp
,
SLT_VCL_trace
,
"%u %
u.%u
"
,
u
,
sp
->
vcl
->
ref
[
u
].
line
,
sp
->
vcl
->
ref
[
u
].
pos
);
}
...
...
@@ -83,7 +83,8 @@ VRT_count(const struct sess *sp, unsigned u)
void
VRT_acl_log
(
const
struct
sess
*
sp
,
const
char
*
msg
)
{
WSP
(
sp
,
SLT_VCL_acl
,
msg
);
WSP
(
sp
,
SLT_VCL_acl
,
"%s"
,
msg
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -416,7 +417,7 @@ VRT_synth_page(const struct sess *sp, unsigned flags, const char *str, ...)
SMS_Finish
(
sp
->
wrk
->
obj
);
http_Unset
(
sp
->
wrk
->
obj
->
http
,
H_Content_Length
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
obj
->
http
,
"Content-Length: %d"
,
sp
->
wrk
->
obj
->
len
);
"Content-Length: %
z
d"
,
sp
->
wrk
->
obj
->
len
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
d763ce00
...
...
@@ -55,7 +55,7 @@ vrt_do_string(struct worker *w, int fd, const struct http *hp, int fld,
AN
(
hp
);
b
=
VRT_String
(
hp
->
ws
,
NULL
,
p
,
ap
);
if
(
b
==
NULL
||
*
b
==
'\0'
)
{
WSL
(
w
,
SLT_LostHeader
,
fd
,
err
);
WSL
(
w
,
SLT_LostHeader
,
fd
,
"%s"
,
err
);
}
else
{
http_SetH
(
hp
,
fld
,
b
);
}
...
...
bin/varnishd/cache/cache_wrw.c
View file @
d763ce00
...
...
@@ -165,7 +165,7 @@ WRW_Flush(struct worker *w)
if
(
i
<=
0
)
{
wrw
->
werr
++
;
WSL
(
w
,
SLT_Debug
,
*
wrw
->
wfd
,
"Write error, retval = %
d, len = %
d, errno = %s"
,
"Write error, retval = %
zd, len = %z
d, errno = %s"
,
i
,
wrw
->
liov
,
strerror
(
errno
));
}
}
...
...
bin/varnishd/flint.lnt
View file @
d763ce00
-d__flexelint_v9__=1
-printf(3, VSL)
-printf(4, http_PrintfHeader)
-printf(4, WSL)
-printf(3, WSLB)
-printf(2, VSB_printf)
-esym(755, vct_*)
-esym(759, vev_*)
-esym(765, vev_*)
...
...
lib/libvcl/vcc_compile.h
View file @
d763ce00
...
...
@@ -308,7 +308,7 @@ void vcc_ErrToken(const struct vcc *tl, const struct token *t);
void
vcc_ErrWhere
(
struct
vcc
*
,
const
struct
token
*
);
void
vcc_ErrWhere2
(
struct
vcc
*
,
const
struct
token
*
,
const
struct
token
*
);
void
vcc__Expect
(
struct
vcc
*
tl
,
unsigned
tok
,
int
line
);
void
vcc__Expect
(
struct
vcc
*
tl
,
unsigned
tok
,
unsigned
line
);
int
vcc_Teq
(
const
struct
token
*
t1
,
const
struct
token
*
t2
);
int
vcc_IdIs
(
const
struct
token
*
t
,
const
char
*
p
);
void
vcc_ExpectCid
(
struct
vcc
*
tl
);
...
...
lib/libvcl/vcc_token.c
View file @
d763ce00
...
...
@@ -104,7 +104,7 @@ vcc_icoord(struct vsb *vsb, const struct token *t, int tail)
}
else
pos
++
;
}
VSB_printf
(
vsb
,
"('%s' Line %
d Pos %d
)"
,
t
->
src
->
name
,
lin
,
pos
+
1
);
VSB_printf
(
vsb
,
"('%s' Line %
u Pos %u
)"
,
t
->
src
->
name
,
lin
,
pos
+
1
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -261,7 +261,7 @@ vcc_NextToken(struct vcc *tl)
}
void
vcc__Expect
(
struct
vcc
*
tl
,
unsigned
tok
,
int
line
)
vcc__Expect
(
struct
vcc
*
tl
,
unsigned
tok
,
unsigned
line
)
{
if
(
tl
->
t
->
tok
==
tok
)
return
;
...
...
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