| | 30 | |
| | 31 | r136377 & r138063 are:[[BR]] |
| | 32 | VBoxService: Use strncmp rather than strcmp as the ut_user field is only zero terminated if the username has shorter than the size of the field (from the utmp manpage) |
| | 33 | {{{ |
| | 34 | Index: trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp |
| | 35 | =================================================================== |
| | 36 | --- trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp (revision 136376) |
| | 37 | +++ trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp (revision 136377) |
| | 38 | @@ -606,7 +606,7 @@ |
| | 39 | { |
| | 40 | bool fFound = false; |
| | 41 | for (uint32_t i = 0; i < cUsersInList && !fFound; i++) |
| | 42 | - fFound = strcmp(papszUsers[i], ut_user->ut_user) == 0; |
| | 43 | + fFound = strncmp(papszUsers[i], ut_user->ut_user, sizeof(ut_user->ut_user)) == 0; |
| | 44 | |
| | 45 | if (!fFound) |
| | 46 | { |
| | 47 | }}} |