VirtualBox

Changeset 83197 in vbox


Ignore:
Timestamp:
Mar 4, 2020 9:18:18 AM (5 years ago)
Author:
vboxsync
Message:

VMM/CPUM: Fix the Timer description string outliving the stack, allocate it on the hyper-heap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r82968 r83197  
    45604560                {
    45614561                    PVMCPU pVCpu = pVM->apCpusR3[idCpu];
    4562                     char aszTimerName[128];
    4563                     RTStrPrintf(&aszTimerName[0], sizeof(aszTimerName), "Nested Guest VMX-preempt. timer %u", idCpu);
     4562                    /* The string cannot live on the stack. It should be safe to call MMR3HeapAPrintf here as
     4563                       MMR3HyperInitFinalize has already completed at this point. */
     4564                    char *pszTimerName = MMR3HeapAPrintf(pVM, MM_TAG_CPUM_CTX, "Nested Guest VMX-preempt. timer %u", idCpu);
    45644565                    int rc = TMR3TimerCreateInternal(pVM, TMCLOCK_VIRTUAL_SYNC, cpumR3VmxPreemptTimerCallback, pVCpu,
    4565                                                      aszTimerName, &pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
     4566                                                     pszTimerName, &pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
    45664567                    AssertLogRelRCReturn(rc, rc);
    45674568                    pVCpu->cpum.s.pNestedVmxPreemptTimerR0 = TMTimerR0Ptr(pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette