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@winehq.org Reporter: lukebenes@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/
https://bugs.winehq.org/show_bug.cgi?id=37121
Luke lukebenes@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |http://www.viva64.com/en/b/ | |0272/
https://bugs.winehq.org/show_bug.cgi?id=37121
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |c5aacafeeaa2cf15612fc531826 | |2140cbd92bd56 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #1 from Bruno Jesus 00cpxxx@gmail.com --- The code was changed and the issue is no longer present.
https://bugs.winehq.org/show_bug.cgi?id=37121
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.30.
https://bugs.winehq.org/show_bug.cgi?id=37121
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |programs