Skip to content
Snippets Groups Projects
Commit 33139245 authored by Russell Bryant's avatar Russell Bryant
Browse files

Resolve another warning.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent b0778107
No related branches found
No related tags found
No related merge requests found
......@@ -315,6 +315,7 @@ static int cops_getmsg (int sfd, struct copsmsg *recmsg)
int len, lent;
char buf[COPS_HEADER_SIZE];
struct pktcobj *pobject = NULL;
uint16_t *ubuf = (uint16_t *) buf;
recmsg->msg = NULL;
recmsg->object = NULL;
len = recv(sfd, buf, COPS_HEADER_SIZE, MSG_DONTWAIT);
......@@ -357,7 +358,7 @@ static int cops_getmsg (int sfd, struct copsmsg *recmsg)
return lent;
}
len += lent;
pobject->length = ntohs(*((uint16_t *) buf));
pobject->length = ntohs(*ubuf);
pobject->cnum = *(buf + 2);
pobject->ctype = *(buf + 3);
if (!(pobject->contents = malloc(pobject->length - COPS_OBJECT_HEADER_SIZE))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment