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:
parent
5408d96b20
commit
42cf823e2f
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Reference in New Issue