projects
/
profile
/
ivi
/
murphy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
362c3d1
)
common: fix a buffer overflow.
author
Ismo Puustinen
<ismo.puustinen@intel.com>
Fri, 7 Feb 2014 09:24:17 +0000
(11:24 +0200)
committer
Krisztian Litkey
<krisztian.litkey@intel.com>
Fri, 7 Feb 2014 14:14:09 +0000
(16:14 +0200)
src/common/stream-transport.c
patch
|
blob
|
history
diff --git
a/src/common/stream-transport.c
b/src/common/stream-transport.c
index
8ed7bc0
..
5a5a016
100644
(file)
--- a/
src/common/stream-transport.c
+++ b/
src/common/stream-transport.c
@@
-172,7
+172,7
@@
static int parse_address(const char *str, int *familyp, char *nodep,
nl = strlen(node);
}
- if (nl > nsize) {
+ if (nl >
=
nsize) {
errno = ENOMEM;
return -1;
}
@@
-193,7
+193,7
@@
static socklen_t strm_resolve(const char *str, mrp_sockaddr_t *addr,
{
struct addrinfo *ai, hints;
struct sockaddr_un *un;
- char node[
512
], *port;
+ char node[
UNIX_PATH_MAX
], *port;
socklen_t len;
mrp_clear(&hints);
@@
-211,7
+211,7
@@
static socklen_t strm_resolve(const char *str, mrp_sockaddr_t *addr,
errno = ENOMEM;
else {
un->sun_family = AF_UNIX;
- str
cpy(un->sun_path, node
);
+ str
ncpy(un->sun_path, node, UNIX_PATH_MAX-1
);
if (un->sun_path[0] == '@')
un->sun_path[0] = '\0';
}