summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2011-03-03 01:02:41 +0000
committerDmitry V. Levin <ldv@altlinux.org>2011-03-03 01:02:41 +0000
commitd475c06134717745987e4c1859e4cdb8d16e2001 (patch)
treeb6b124e1838a667fc159edcc1edaaee0d02167d8 /net.c
parentf9a84ef39fdbfe9636837c99beff52d62a7b8127 (diff)
downloadstrace-d475c06134717745987e4c1859e4cdb8d16e2001.tar.gz
strace-d475c06134717745987e4c1859e4cdb8d16e2001.tar.bz2
strace-d475c06134717745987e4c1859e4cdb8d16e2001.tar.xz
Fix struct xlat initialization bugs
* file.c (inotify_modes): Terminate with NULL entry. * net.c (sock_type_flags): Make this array static. (socketlayers): Add a comment that this array should remain not NULL-terminated.
Diffstat (limited to 'net.c')
-rw-r--r--net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net.c b/net.c
index 26cfeb0..cafa739 100644
--- a/net.c
+++ b/net.c
@@ -337,7 +337,7 @@ static const struct xlat socktypes[] = {
#endif
{ 0, NULL },
};
-const struct xlat sock_type_flags[] = {
+static const struct xlat sock_type_flags[] = {
#ifdef SOCK_CLOEXEC
{ SOCK_CLOEXEC, "SOCK_CLOEXEC" },
#endif
@@ -447,6 +447,7 @@ static const struct xlat socketlayers[] = {
{ SOL_CAIF, "SOL_CAIF" },
#endif
{ SOL_SOCKET, "SOL_SOCKET" }, /* Never used! */
+ /* The SOL_* array should remain not NULL-terminated. */
};
/*** WARNING: DANGER WILL ROBINSON: NOTE "socketlayers" array above
falls into "protocols" array below!!!! This is intended!!! ***/