[PATCH] fix strace -s N handling

Dmitry V. Levin ldv at altlinux.org
Thu Nov 6 11:24:19 UTC 2008


On Wed, Nov 05, 2008 at 07:18:45PM +0100, Denys Vlasenko wrote:
> On Wed, 2008-11-05 at 15:16 +0100, Denys Vlasenko wrote:
> > Before this patch, -s N shows N+1 chars in strings.
> > More annoyingly, it shows this for shorter strings:
> > 
> > write(1, "hi\n"..., 3) = 3
> > 
> > After patch:
> > 
> > write(1, "hi\n", 3) = 3
> > 
> > Patch author is Jeff Bastian jbastian at redhat.com
> > 
> > Patch is below. Please apply.
> 
> It appears that the bug this patch fixes causes buffer overruns
> and corrupts memory since we malloc just enough space for N chars
> + NUL but then try to stuff N+1 chars + NUL there.
> 
> See https://bugzilla.redhat.com/show_bug.cgi?id=466877

This bug is not available for public access.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20081106/548f5cbe/attachment.bin>


More information about the Strace-devel mailing list