On to, 2011-02-10 at 10:29 -0300, Eduardo Silva wrote:
[PATCH] Add safe string manipulation functions
Deprecate direct use of strcpy(3)
The following string manipulation function has been added:
- string_copy() : wrapper of strcpy(3)
- string_ncopy(): wrapper of strncpy(3)
both
On Thu, Feb 10, 2011 at 12:37 PM, Jeremy Sanders
jer...@jeremysanders.net wrote:
Olaf van der Spek wrote:
On Thu, Feb 10, 2011 at 12:08 PM, Thomas Bellman bell...@nsc.liu.se
wrote:
strncpy(args.name, source, BTRFS_PATH_NAME_MAX);
args.name[BTRFS_PATH_NAME_MAX] = '\0';
That's silly. Isn't
On to, 2011-02-10 at 11:37 +, Jeremy Sanders wrote:
There's strlcpy, but it's not in glibc because of possible truncation
errors!
snprintf is standard, and should be about as safe as it gets with the
glibc functions.
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs
On Thu, Feb 10, 2011 at 12:54 PM, Lars Wirzenius l...@liw.fi wrote:
On to, 2011-02-10 at 11:37 +, Jeremy Sanders wrote:
There's strlcpy, but it's not in glibc because of possible truncation
errors!
snprintf is standard, and should be about as safe as it gets with the
glibc functions.
On 2011-02-10 13:27, Olaf van der Spek wrote:
On Thu, Feb 10, 2011 at 12:54 PM, Lars Wirzenius l...@liw.fi wrote:
snprintf is standard, and should be about as safe as it gets with the
glibc functions.
But snprintf is not like strlcpy.
It is indeed uglier to write 'snprintf(dst, size, %s,
On Thu, 2011-02-10 at 12:39 +0100, Olaf van der Spek wrote:
On Thu, Feb 10, 2011 at 12:37 PM, Jeremy Sanders
jer...@jeremysanders.net wrote:
Olaf van der Spek wrote:
On Thu, Feb 10, 2011 at 12:08 PM, Thomas Bellman bell...@nsc.liu.se
wrote:
strncpy(args.name, source,
On Thu, Feb 10, 2011 at 12:37 PM, Jeremy Sanders
jer...@jeremysanders.net wrote:
Of course C++ strings would be much better... :-)
Yeah, why isn't C++ being used?
Olaf
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
On 02/10/2011 02:29 PM, Eduardo Silva wrote:
On Thu, 2011-02-10 at 12:39 +0100, Olaf van der Spek wrote:
On Thu, Feb 10, 2011 at 12:37 PM, Jeremy Sanders
jer...@jeremysanders.net wrote:
Olaf van der Spek wrote:
On Thu, Feb 10, 2011 at 12:08 PM, Thomas Bellman bell...@nsc.liu.se
wrote:
On 02/07/2011 01:22 PM, Eduardo Silva wrote:
Please find the attached patch which replace unsafe strcpy(3) by
strncpy(3) functions.
regards,
Eduardo Silva
Hi Eduardo,
even though some strncpy are unneeded because a check is performed
before, I fully agree that strncpy is better than a