[Bug 37121] New: PVS-Studio Error: String length changing
https://bugs.winehq.org/show_bug.cgi?id=37121 Bug ID: 37121 Summary: PVS-Studio Error: String length changing Product: Wine Version: 1.7.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: lukebenes(a)hotmail.com PVS-Studio identifies a V692 error, An inappropriate attempt to append a null character to a string. To determine the length of a string by 'strlen' function correctly, a string ending with a null terminator should be used in the first place. appdefaults.c 390 ... section[strlen(section)] = '\0'; /* remove last backslash */ ... In this code, NULL character will actually be written into NULL character and nothing will change. For the strlen() function to work properly, the string must be already null-terminated. The comment suggests that the programmer probably wanted to cut off the last backslash. Then the code should look like this: section[strlen(section) - 1] = '\0'; details on the V692 error here: http://www.viva64.com/en/d/0328/ -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37121 Luke <lukebenes(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |http://www.viva64.com/en/b/ | |0272/ -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37121 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |c5aacafeeaa2cf15612fc531826 | |2140cbd92bd56 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #1 from Bruno Jesus <00cpxxx(a)gmail.com> --- The code was changed and the issue is no longer present. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37121 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #2 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.7.30. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=37121 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |programs -- 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