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
24459e2e
Commit
24459e2e
authored
May 12, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use snprintf() instead of strlcpy()
parent
f4390be4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
tcp.c
lib/libvarnish/tcp.c
+4
-7
No files found.
lib/libvarnish/tcp.c
View file @
24459e2e
...
...
@@ -52,9 +52,6 @@
#include <math.h>
#include "config.h"
#ifndef HAVE_STRLCPY
#include "compat/strlcpy.h"
#endif
#include "libvarnish.h"
...
...
@@ -92,8 +89,8 @@ TCP_name(const struct sockaddr_storage *addr, unsigned l,
* for the gai_strerror in the bufffer :-(
*/
printf
(
"getnameinfo = %d %s
\n
"
,
i
,
gai_strerror
(
i
));
s
trlcpy
(
abuf
,
"Conversion"
,
alen
);
s
trlcpy
(
pbuf
,
"Failed"
,
plen
);
s
nprintf
(
abuf
,
alen
,
"Conversion"
);
s
nprintf
(
pbuf
,
plen
,
"Failed"
);
return
;
}
/* XXX dirty hack for v4-to-v6 mapped addresses */
...
...
@@ -128,8 +125,8 @@ TCP_hisname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen)
if
(
!
getpeername
(
sock
,
(
void
*
)
&
addr_s
,
&
l
))
TCP_name
(
&
addr_s
,
l
,
abuf
,
alen
,
pbuf
,
plen
);
else
{
s
trlcpy
(
abuf
,
"<none>"
,
alen
);
s
trlcpy
(
pbuf
,
"<none>"
,
plen
);
s
nprintf
(
abuf
,
alen
,
"<none>"
);
s
nprintf
(
pbuf
,
plen
,
"<none>"
);
}
}
...
...
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