This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6919] posix_spawnattr_getschedparam overwrites unrelated memory
- From: "bruno at clisp dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 2 Nov 2008 00:55:30 -0000
- Subject: [Bug libc/6919] posix_spawnattr_getschedparam overwrites unrelated memory
- References: <20080927183249.6919.bruno@clisp.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From bruno at clisp dot org 2008-11-02 00:55 -------
> I fixed the code bug by leaving the memcpy. The compiler is smart enough.
The point about using an assignment rather than memcpy is that the compiler
would have reported this bug as an error already.
When you use an assignment, the compiler verifies that the source type and the
target type are the same. When you use memcpy, it doesn't.
Even excellent programmers occasionally make mistakes, like in this case. The
compiler can prevent you from making this kind of mistake.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6919
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.