Re: [PATCH 1/2] imap-send: fix bug causing cfg->folder being set to NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 22, 2025 at 02:25:47PM -0400, Eric Sunshine wrote:

> It's subjective, but I would probably fix this a little bit
> differently and (to my mind) more simply:
> 
>     response = cram(prompt, ctx->cfg->user, ctx->cfg->pass);
> 
>     ret = socket_write(&ctx->imap->buf.sock, response, strlen(response));
>     free(response);
>     if (ret != strlen(response))
>         return error("IMAP error: sending response failed");

Doesn't that introduce a use-after-free for response? You'd have to
store the strlen() result in a local variable.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux