Correct mistake in dcb_read; use larger integer to accomodate three byte length in modutil.

This commit is contained in:
counterpoint
2015-07-18 16:21:29 +01:00
committed by Martin Brampton
parent 56620bfcf7
commit 4a0925f33d
2 changed files with 2 additions and 2 deletions

View File

@ -831,7 +831,7 @@ int dcb_read(
dcb->last_read = hkheartbeat; dcb->last_read = hkheartbeat;
bufsize = MIN(bytesavailable, MAX_BUFFER_SIZE); bufsize = MIN(bytesavailable, MAX_BUFFER_SIZE);
if (maxbytes) bufsize = MIN(bufsize, maxbytes); if (maxbytes) bufsize = MIN(bufsize, maxbytes-nreadtotal);
if ((buffer = gwbuf_alloc(bufsize)) == NULL) if ((buffer = gwbuf_alloc(bufsize)) == NULL)
{ {

View File

@ -540,7 +540,7 @@ GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf)
{ {
GWBUF *buff = NULL, *packet; GWBUF *buff = NULL, *packet;
uint8_t *ptr; uint8_t *ptr;
int len,blen,total = 0; uint32_t len,blen,total = 0;
if(p_readbuf == NULL || (*p_readbuf) == NULL || if(p_readbuf == NULL || (*p_readbuf) == NULL ||
gwbuf_length(*p_readbuf) < 3) gwbuf_length(*p_readbuf) < 3)