From: "Sören Tempel" <soeren@soeren-tempel.net>
To: util-linux@vger.kernel.org
Subject: Re: [PATCH v2] libmount: Fix access to uninitialised value in mnt_optstr_locate_option
Date: Sat, 25 Feb 2023 14:40:52 +0100 [thread overview]
Message-ID: <3E04KR1SLWLFQ.25IAX13LC3PWS@8pit.net> (raw)
In-Reply-To: <20230225124131.10401-1-soeren@soeren-tempel.net>
soeren@soeren-tempel.net wrote:
> xstrncpy(buf, name, namesz + 1);
> + if (namesz == 0) { /* if xstrncpy didn't copy anything */
> + free(buf);
> + buf = NULL;
> + }
This solution also has the issue that it handles the case incorrectly
where xstrncpy actually calls strlen(3). I wanted to avoid that but
maybe the best solution is to just change the xstrncpy API in a way that
it indicates whether it has written anything through an int return
value?
Sorry for all the noise. Next time, I will just write a bug report...
Greetings,
Sören
next prev parent reply other threads:[~2023-02-25 13:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 11:43 [PATCH] libmount: Fix access to uninitialised value in mnt_optstr_locate_option soeren
2023-02-25 12:41 ` [PATCH v2] " soeren
2023-02-25 13:40 ` Sören Tempel [this message]
2023-02-27 10:50 ` Karel Zak
2023-02-27 19:00 ` Sören Tempel
2023-02-28 11:02 ` Karel Zak
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=3E04KR1SLWLFQ.25IAX13LC3PWS@8pit.net \
--to=soeren@soeren-tempel.net \
--cc=util-linux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox