VirtualBox

Changes between Version 4 and Version 5 of Ticket #19537, comment 5


Ignore:
Timestamp:
May 19, 2020 2:00:21 PM (4 years ago)
Author:
Frank Batschulat (Oracle)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19537, comment 5

    v4 v5  
    2828                 case CPU_SUBTYPE_X86_64_ALL:    return "X86_64/ALL64";
    2929}}}}
     30
     31r136377 & r138063 are:[[BR]]
     32VBoxService: 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{{{
     34Index: 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}}}

© 2023 Oracle
ContactPrivacy policyTerms of Use