9
0
Fork 0

misc: Address warnings coming from clang

* Include stdlib.h before the snmp headers to have a free declaration
* Use sprintf(dest, "%s", str) to avoid format string attacks
* Avoid bogus assignment. This pattern was used for marking something
  as unused in the past.
This commit is contained in:
Holger Hans Peter Freyther 2013-03-11 17:19:18 +01:00
parent e6caed12ca
commit d93c84f96e
3 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,8 @@
#ifndef snmp_mtp_h
#define snmp_mtp_h
#include <stdlib.h>
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/utilities.h>
#include <net-snmp/net-snmp-includes.h>

View File

@ -47,7 +47,6 @@ int sctp_m2ua_conn_count(struct sctp_m2ua_transport *trans)
static struct mtp_m2ua_link *find_m2ua_link(struct sctp_m2ua_transport *trans, int link_index)
{
struct mtp_m2ua_link *link;
link_index = link_index;
llist_for_each_entry(link, &trans->links, entry) {
if (link->link_index == link_index)

View File

@ -197,7 +197,7 @@ static struct msgb *create_msg(const char *str)
struct msgb *msg;
msg = msgb_alloc_headroom(4096, 128, "MGCP msg");
int len = sprintf((char *)msg->data, str);
int len = sprintf((char *)msg->data, "%s", str);
msg->l2h = msgb_put(msg, len);
return msg;
}