All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: jianchunfu <jianchunfu@cmss.chinamobile.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] fs:unicode:mkutf8data.c: Fix the potential stack overflow risk
Date: Fri, 25 Mar 2022 17:25:35 -0400	[thread overview]
Message-ID: <87o81tpvw0.fsf@collabora.com> (raw)
In-Reply-To: <20220325091443.59677-1-jianchunfu@cmss.chinamobile.com> (jianchunfu@cmss.chinamobile.com's message of "Fri, 25 Mar 2022 17:14:43 +0800")

jianchunfu <jianchunfu@cmss.chinamobile.com> writes:

> I'm not sure why there are so many missing checks of the malloc function,
> is it because the memory allocated is only a few bytes
> so no checks are needed?
>
> Signed-off-by: jianchunfu <jianchunfu@cmss.chinamobile.com>

Hi jianchunfu,

Thanks for the patch.

Beyond what Eric said, the patch prefix should be just "unicode:".  When
in doubt you can see the previous patches to the subsystem in the git
log.  Also, I think these are not really  stack overflows, but a bad
memory access if malloc fails.  What do you think of something like

unicode: Handle memory allocation failures in mkutf8data

or something like that.

Thanks,

-- 
Gabriel Krisman Bertazi

      parent reply	other threads:[~2022-03-25 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  9:14 [RFC] fs:unicode:mkutf8data.c: Fix the potential stack overflow risk jianchunfu
2022-03-25 20:33 ` Eric Biggers
2022-03-25 21:25 ` Gabriel Krisman Bertazi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o81tpvw0.fsf@collabora.com \
    --to=krisman@collabora.com \
    --cc=jianchunfu@cmss.chinamobile.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.