[Bug 34211] New: strncpy C library function doesn't compliant C standard.
http://bugs.winehq.org/show_bug.cgi?id=34211 Bug #: 34211 Summary: strncpy C library function doesn't compliant C standard. Product: Wine Version: 1.7.0 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs(a)winehq.org ReportedBy: alvaro.nieto(a)gmail.com Classification: Unclassified Created attachment 45514 --> http://bugs.winehq.org/attachment.cgi?id=45514 Program that shows the bug and patch that solves it
From standard;
"If the array pointed to by s2 is a string that is shorter than n bytes, null bytes shall be appended to the copy in the array pointed to by s1,until n bytes in all are written" The attached code doesn't prints anything in Windows and Linux but prints in wine because wine's strncpy doesn't append null bytes. Also I've included a patch that solves the problem. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 Alvaro Nieto <alvaro.nieto(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alvaro.nieto(a)gmail.com -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, patch, testcase --- Comment #1 from Austin English <austinenglish(a)gmail.com> 2013-08-05 17:32:42 CDT --- Patches should be sent to wine-patches(a)winehq.org. See http://wiki.winehq.org/SubmittingPatches -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 --- Comment #2 from Bruno Jesus <00cpxxx(a)gmail.com> 2013-08-05 18:46:46 CDT ---
for(i=0; i<sizeof(src); i++) ... for(i=sizeof(src)+1; i<len; i++)
I think you need strlen instead of sizeof, but IMO there seems to be an easier way to do it. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |e3e12845572dce7b35660814c44 | |dedf069de1dfb Status|UNCONFIRMED |RESOLVED Resolution| |FIXED --- Comment #3 from Bruno Jesus <00cpxxx(a)gmail.com> 2013-08-16 14:43:34 CDT --- Patch commited, thanks for your work. http://source.winehq.org/git/wine.git/?a=commit;h=e3e12845572dce7b35660814c4... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #4 from Alexandre Julliard <julliard(a)winehq.org> 2013-08-30 13:06:10 CDT --- Closing bugs fixed in 1.7.1. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.6.x -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34211 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.6.x |--- --- Comment #5 from Alexandre Julliard <julliard(a)winehq.org> 2013-11-15 13:40:31 CST --- Removing 1.6.x milestone from bugs included in 1.6.1. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org