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/