diff options
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r-- | WWW/Library/Implementation/HTChunk.c | 11 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTCP.c | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c index 6b670116..b9490fd6 100644 --- a/WWW/Library/Implementation/HTChunk.c +++ b/WWW/Library/Implementation/HTChunk.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTChunk.c,v 1.28 2016/11/24 15:29:50 tom Exp $ + * $LynxId: HTChunk.c,v 1.29 2023/04/10 22:58:51 tom Exp $ * * Chunk handling: Flexible arrays * =============================== @@ -197,13 +197,16 @@ HTChunk *HTChunkPutb2(HTChunk *ch, const char *b, int l) HTChunk *chunk; int m = ch->allocated - ch->size; - MemCpy(ch->data + ch->size, b, (unsigned) m); - ch->size += m; + if (m != 0 && b != 0) { + MemCpy(ch->data + ch->size, b, (unsigned) m); + ch->size += m; + } chunk = HTChunkCreateMayFail(ch->growby, ch->failok); ch->next = chunk; ch = chunk; - HTChunkPutb(ch, b + m, l - m); + if (b != 0) + HTChunkPutb(ch, b + m, l - m); } else { MemCpy(ch->data + ch->size, b, (unsigned) l); ch->size += l; diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index a3bfda62..087f515a 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTCP.c,v 1.163 2022/04/01 23:18:35 Rajeev.V.Pillai Exp $ + * $LynxId: HTTCP.c,v 1.164 2023/04/10 22:41:21 tom Exp $ * * Generic Communication Code HTTCP.c * ========================== @@ -1494,7 +1494,7 @@ static size_t fill_addrinfo(void **buffer, CTRACE((tfp, "filladdr_info %p\n", (const void *) phost)); for (q = phost; q != 0; q = q->ai_next) { ++limit; - need += phost->ai_addrlen; + need += q->ai_addrlen; need += sizeof(LYNX_ADDRINFO); } CTRACE((tfp, "...fill_addrinfo %d:%lu\n", limit, (unsigned long) need)); |