chiark
/
gitweb
/
~mdw
/
preload-hacks
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a863a3
)
noip.c: Make sure it's an AF_UNIX address before counting the length.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 5 Jun 2010 13:45:01 +0000
(14:45 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 5 Jun 2010 13:45:01 +0000
(14:45 +0100)
noip.c
patch
|
blob
|
blame
|
history
diff --git
a/noip.c
b/noip.c
index bcba77feceaa81b25eb4195307b615cff3539609..06a07c6def713fa37a032b4acec53087156ef37f 100644
(file)
--- a/
noip.c
+++ b/
noip.c
@@
-352,7
+352,7
@@
static int decode_inet_addr(struct sockaddr_in *sin,
{
char buf[INET_ADDRSTRLEN + 16];
char *p;
- size_t n = strlen(sockdir), nn
= strlen(sun->sun_path)
;
+ size_t n = strlen(sockdir), nn;
struct sockaddr_in sin_mine;
unsigned long port;
@@
-360,6
+360,7
@@
static int decode_inet_addr(struct sockaddr_in *sin,
sin = &sin_mine;
if (sun->sun_family != AF_UNIX)
return (-1);
+ nn = strlen(sun->sun_path);
if (len < sizeof(sun)) ((char *)sun)[len] = 0;
D( fprintf(stderr, "noip: decode (%d) `%s'",
*sun->sun_path, sun->sun_path); )