VirtualBox

Ticket #1409 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

"pcnetGetMac" error in source code

Reported by: xasm2008 Owned by:
Priority: major Component: other
Version: VirtualBox 1.5.6 Keywords: pcnetGetMac
Cc: Guest type: other
Host type: other

Description

Hi,

I found a bug on the input parameter for a function in source code(maybe a "clerical error"),Although the function hasn't been used as yet , I think it will cause the problem if it is used. here are the information for the bug:

function name:pcnetGetMac,

file:/src/vbox/devices/network/devpcnet.cpp static DECLCALLBACK(int) pcnetGetMac(PPDMINETWORKCONFIG pInterface, PPDMMAC *pMac) {

PCNetState *pData = INETWORKCONFIG_2_DATA(pInterface); memcpy(pMac, pData->aPROM, sizeof(*pMac)); return VINF_SUCCESS;

}

file:/include/vbox/pdmifs.h typedef PDMMAC *PPDMMAC; DECLR3CALLBACKMEMBER(int, pfnGetMac,(PPDMINETWORKCONFIG pInterface, PPDMMAC *pMac));

the purpose on function is to output MAC address(6 Bytes), but pay attention to the second input parameter, the type is "PPDMMAC *" (double pointer), after execute "memcpy(pMac, pData->aPROM, sizeof(*pMac))", obviously it can't get result that we want.

so,it should change the type for input parameter from "PPDMMAC *" to "PPDMMAC".

Change History

comment:1 Changed 6 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Thank you for this report. I've fixed that in SVN. The changes are visible in the public SVN after the next sync.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use