Re: [PATCH v2] nbd/client: Use smarter assert

2022-10-31 Thread Eric Blake
On Mon, Oct 24, 2022 at 02:59:48PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 10/17/22 22:12, Eric Blake wrote: > > Assigning strlen() to a uint32_t and then asserting that it isn't too > > large doesn't catch the case of an input string 4G in length. > > Thankfully, the incoming strings can n

Re: [PATCH v2] nbd/client: Use smarter assert

2022-10-24 Thread Vladimir Sementsov-Ogievskiy
On 10/17/22 22:12, Eric Blake wrote: Assigning strlen() to a uint32_t and then asserting that it isn't too large doesn't catch the case of an input string 4G in length. Thankfully, the incoming strings can never be that large: if the export name or query is reflecting a string the client got from

Re: [PATCH v2] nbd/client: Use smarter assert

2022-10-18 Thread Philippe Mathieu-Daudé
On 17/10/22 21:12, Eric Blake wrote: Assigning strlen() to a uint32_t and then asserting that it isn't too large doesn't catch the case of an input string 4G in length. Thankfully, the incoming strings can never be that large: if the export name or query is reflecting a string the client got from

Re: [PATCH v2] nbd/client: Use smarter assert

2022-10-18 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > Assigning strlen() to a uint32_t and then asserting that it isn't too > large doesn't catch the case of an input string 4G in length. > Thankfully, the incoming strings can never be that large: if the > export name or query is reflecting a string the client

[PATCH v2] nbd/client: Use smarter assert

2022-10-17 Thread Eric Blake
Assigning strlen() to a uint32_t and then asserting that it isn't too large doesn't catch the case of an input string 4G in length. Thankfully, the incoming strings can never be that large: if the export name or query is reflecting a string the client got from the server, we already guarantee that