projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ae6a39b
)
- fix coverity 10086
author
Bart Polot
<bart@net.in.tum.de>
Mon, 23 Jul 2012 13:45:07 +0000
(13:45 +0000)
committer
Bart Polot
<bart@net.in.tum.de>
Mon, 23 Jul 2012 13:45:07 +0000
(13:45 +0000)
src/mesh/mesh_api.c
patch
|
blob
|
history
diff --git
a/src/mesh/mesh_api.c
b/src/mesh/mesh_api.c
index f29ebe9d21b76eb9f9390e7e0f46157b88041cb1..935c99574dc1eedd2ada5f13df5ce512437edf26 100644
(file)
--- a/
src/mesh/mesh_api.c
+++ b/
src/mesh/mesh_api.c
@@
-1419,12
+1419,16
@@
GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
msgsize = sizeof(struct GNUNET_MessageHeader) + len;
GNUNET_assert (UINT16_MAX > msgsize);
msgsize = sizeof(struct GNUNET_MessageHeader) + len;
GNUNET_assert (UINT16_MAX > msgsize);
- msg = GNUNET_malloc (msgsize);
- msg->size = htons (msgsize);
- msg->type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_ANNOUNCE_REGEX);
- memcpy (&msg[1], regex, len);
+ {
+ char buffer[msgsize];
- send_packet(h, msg, NULL);
+ msg = (struct GNUNET_MessageHeader *) buffer;
+ msg->size = htons (msgsize);
+ msg->type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_ANNOUNCE_REGEX);
+ memcpy (&msg[1], regex, len);
+
+ send_packet(h, msg, NULL);
+ }
}
/**
}
/**