This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6919] posix_spawnattr_getschedparam overwrites unrelated memory


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]