Fixed potential segmentation faults

This commit is contained in:
Stefan Wahren
2012-05-18 13:35:02 +02:00
parent 2c98c6c54d
commit 11f6392df3
4 changed files with 99 additions and 43 deletions

View File

@ -165,6 +165,9 @@ mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame)
{
char buff[PACKET_BUFF_SIZE];
int len, remaining, nread;
if (handle == NULL || frame == NULL)
return -1;
bzero((void *)buff, sizeof(buff));