diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2023-04-10 22:59:30 +0000 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2023-04-10 23:07:19 +0000 |
commit | e54344bd3252108c7c113ea773b3ae9a4e72b427 (patch) | |
tree | 8467cdd95f1ebff2c67e6c40e2fde215c29bfa2f /WWW/Library/Implementation | |
parent | af045e28723db5f3a7d2d2c320efe3f281ac85c2 (diff) | |
download | lynx-snapshots-e54344bd3252108c7c113ea773b3ae9a4e72b427.tar.gz |
snapshot of project "lynx", label v2-9-0dev_12c
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)); |