[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wget2 | Draft: Small fixes (!505)
From: |
@rockdaboot |
Subject: |
Re: wget2 | Draft: Small fixes (!505) |
Date: |
Sun, 29 May 2022 15:16:32 +0000 |
Tim Rühsen started a new discussion on libwget/buffer.c:
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_963553329
> else
> memset(buf->data + buf->length, 0, length);
> buf->length += length;
> + buf->data[buf->length] = 0; // always 0 terminate data to allow
> string functions
This won't work. Take a look at `wget_buffer_memcpy()` and think of a re-used
buffer and a length param of 0. In this case and with your change, the caller
would see the previous data string instead of an empty string.
Maybe we should make up a test for this case.
--
Reply to this email directly or view it on GitLab:
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_963553329
You're receiving this email because of your account on gitlab.com.
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/28
- Re: wget2 | Draft: Small fixes (!505),
@rockdaboot <=
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/29
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/29
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/29
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/29
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/29
- Re: wget2 | Draft: Small fixes (!505), @rockdaboot, 2022/05/29