diff options
-rw-r--r-- | CHANGES | 9 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTChunk.c | 11 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTCP.c | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES index 2ef87bcb..710c5f58 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,14 @@ --- $LynxId: CHANGES,v 1.1132 2023/02/17 22:10:26 tom Exp $ +-- $LynxId: CHANGES,v 1.1133 2023/04/10 22:59:30 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2023-02-17 (2.9.0dev.13) +2023-04-10 (2.9.0dev.13) ++ modify HTChunkPutb2() to avoid passing a zero-size or null pointer to + memcpy() -TD +* correct loop in fill_addrinfo() which adds sizes of struct addrinfo's found + in getaddrinfo() call; the 2.8.8dev.15 change did not update the pointer to + the struct addrinfo's (Redhat #2185402) -TD * modify configure script to reduce implicit-function warnings -TD * add viewport meta-tag to documentation/test files -TD 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)); |