Changeset 47117 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 12, 2013 12:48:17 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/initterm.cpp
r46651 r47117 346 346 return NS_ERROR_FILE_ACCESS_DENIED; 347 347 AssertRCReturn(vrc, NS_ERROR_FAILURE); 348 strcpy(szXptiDat, szCompReg);349 348 vrc = RTStrCopy(szXptiDat, sizeof(szXptiDat), szCompReg); 349 AssertRCReturn(vrc, NS_ERROR_FAILURE); 350 350 vrc = RTPathAppend(szCompReg, sizeof(szCompReg), "compreg.dat"); 351 351 AssertRCReturn(vrc, NS_ERROR_FAILURE); … … 397 397 { 398 398 /* Iterate over all other paths */ 399 szAppHomeDir[RTPATH_MAX - 1] = '\0'; 400 strncpy(szAppHomeDir, kAppPathsToProbe[i], RTPATH_MAX - 1); 399 RTStrCopy(szAppHomeDir, sizeof(szAppHomeDir), kAppPathsToProbe[i]); 401 400 vrc = VINF_SUCCESS; 402 401 } … … 406 405 continue; 407 406 } 408 409 407 char szCompDir[RTPATH_MAX]; 410 vrc = RTPathAppend(strcpy(szCompDir, szAppHomeDir), sizeof(szCompDir), "components"); 408 vrc = RTStrCopy(szCompDir, sizeof(szCompDir), szAppHomeDir); 409 if (RT_FAILURE(vrc)) 410 { 411 rc = NS_ERROR_FAILURE; 412 continue; 413 } 414 vrc = RTPathAppend(szCompDir, sizeof(szCompDir), "components"); 411 415 if (RT_FAILURE(vrc)) 412 416 { -
trunk/src/VBox/Main/include/netif.h
r45367 r47117 129 129 return VERR_INVALID_PARAMETER; 130 130 131 memset(aAddrPtr, 0, sizeof(RTNETADDRIPV6));131 RT_ZERO(*aAddrPtr); 132 132 133 133 ASMBitSetRange(aAddrPtr, 0, cPrefix); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r47106 r47117 405 405 LogFlowThisFunc(("\n")); 406 406 407 memset(mapStorageLeds, 0, sizeof(mapStorageLeds));408 memset(mapNetworkLeds, 0, sizeof(mapNetworkLeds));409 memset(&mapUSBLed, 0, sizeof(mapUSBLed));410 memset(&mapSharedFolderLed, 0, sizeof(mapSharedFolderLed));407 RT_ZERO(mapStorageLeds); 408 RT_ZERO(mapNetworkLeds); 409 RT_ZERO(mapUSBLed); 410 RT_ZERO(mapSharedFolderLed); 411 411 412 412 for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++i) … … 8297 8297 */ 8298 8298 struct ifreq IfReq; 8299 memset(&IfReq, 0, sizeof(IfReq));8299 RT_ZERO(IfReq); 8300 8300 /* The name of the TAP interface we are using */ 8301 8301 Bstr tapDeviceName; … … 8313 8313 /* If we are using a static TAP device then try to open it. */ 8314 8314 Utf8Str str(tapDeviceName); 8315 if (str.length() <= sizeof(IfReq.ifr_name)) 8316 strcpy(IfReq.ifr_name, str.c_str()); 8317 else 8318 memcpy(IfReq.ifr_name, str.c_str(), sizeof(IfReq.ifr_name) - 1); /** @todo bitch about names which are too long... */ 8315 RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), str.c_str()); /** @todo bitch about names which are too long... */ 8319 8316 IfReq.ifr_flags = IFF_TAP | IFF_NO_PI; 8320 8317 rcVBox = ioctl(maTapFD[slot], TUNSETIFF, &IfReq); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r47018 r47117 1915 1915 Assert(strlen(macStr) == 12); 1916 1916 RTMAC Mac; 1917 memset(&Mac, 0, sizeof(Mac));1917 RT_ZERO(Mac); 1918 1918 char *pMac = (char*)&Mac; 1919 1919 for (uint32_t i = 0; i < 6; ++i) … … 4397 4397 struct ifreq Req; 4398 4398 RT_ZERO(Req); 4399 strncpy(Req.ifr_name, pszBridgedIfName, sizeof(Req.ifr_name) - 1);4399 RTStrCopy(Req.ifr_name, sizeof(Req.ifr_name), pszBridgedIfName); 4400 4400 if (ioctl(iSock, SIOCGIFFLAGS, &Req) >= 0) 4401 4401 if ((Req.ifr_flags & IFF_UP) == 0) … … 4446 4446 struct iwreq WRq; 4447 4447 4448 memset(&WRq, 0, sizeof(WRq));4448 RT_ZERO(WRq); 4449 4449 strncpy(WRq.ifr_name, pszBridgedIfName, IFNAMSIZ); 4450 4450 bool fSharedMacOnWire = ioctl(iSock, SIOCGIWNAME, &WRq) >= 0; … … 4467 4467 uint8_t abData[32]; 4468 4468 4469 memset(&WReq, 0, sizeof(WReq));4469 RT_ZERO(WReq); 4470 4470 strncpy(WReq.i_name, pszBridgedIfName, sizeof(WReq.i_name)); 4471 4471 WReq.i_type = IEEE80211_IOC_SSID; -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r47113 r47117 1351 1351 m_InputSynch.fClientScrollLock = false; 1352 1352 1353 memset(maFramebuffers, 0, sizeof(maFramebuffers));1353 RT_ZERO(maFramebuffers); 1354 1354 1355 1355 { … … 1377 1377 */ 1378 1378 m_fInterfaceImage = false; 1379 memset(&m_interfaceImage, 0, sizeof (m_interfaceImage));1380 memset(&m_interfaceCallbacksImage, 0, sizeof (m_interfaceCallbacksImage));1379 RT_ZERO(m_interfaceImage); 1380 RT_ZERO(m_interfaceCallbacksImage); 1381 1381 RT_ZERO(m_interfaceMousePtr); 1382 1382 RT_ZERO(m_interfaceSCard); … … 1416 1416 { 1417 1417 RTCritSectDelete(&mCritSect); 1418 memset(&mCritSect, 0, sizeof(mCritSect));1418 RT_ZERO(mCritSect); 1419 1419 } 1420 1420 … … 1422 1422 { 1423 1423 RTCritSectDelete(&mTSMFLock); 1424 memset(&mTSMFLock, 0, sizeof(mTSMFLock));1424 RT_ZERO(mTSMFLock); 1425 1425 } 1426 1426 } … … 2586 2586 pThis->tsmfUnlock(); 2587 2587 2588 memset(pVRDPCtx, 0, sizeof(*pVRDPCtx));2588 RT_ZERO(*pVRDPCtx); 2589 2589 RTMemFree(pVRDPCtx); 2590 2590 } -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r46828 r47117 149 149 { 150 150 RTCritSectDelete (&mVBVALock); 151 memset (&mVBVALock, 0, sizeof (mVBVALock));151 RT_ZERO(mVBVALock); 152 152 } 153 153 … … 155 155 { 156 156 RTCritSectDelete(&mSaveSeamlessRectLock); 157 memset(&mSaveSeamlessRectLock, 0, sizeof (mSaveSeamlessRectLock));157 RT_ZERO(mSaveSeamlessRectLock); 158 158 } 159 159 BaseFinalRelease(); … … 489 489 maFramebuffers[ul].mpSavedVisibleRegion = NULL; 490 490 491 memset (&maFramebuffers[ul].dirtyRect, 0 , sizeof (maFramebuffers[ul].dirtyRect));492 memset (&maFramebuffers[ul].pendingResize, 0 , sizeof (maFramebuffers[ul].pendingResize));491 RT_ZERO(maFramebuffers[ul].dirtyRect); 492 RT_ZERO(maFramebuffers[ul].pendingResize); 493 493 #ifdef VBOX_WITH_HGSMI 494 494 maFramebuffers[ul].fVBVAEnabled = false; 495 495 maFramebuffers[ul].cVBVASkipUpdate = 0; 496 memset (&maFramebuffers[ul].vbvaSkippedRect, 0, sizeof (maFramebuffers[ul].vbvaSkippedRect));496 RT_ZERO(maFramebuffers[ul].vbvaSkippedRect); 497 497 maFramebuffers[ul].pVBVAHostFlags = NULL; 498 498 #endif /* VBOX_WITH_HGSMI */ … … 1244 1244 DISPLAYFBINFO *pFBInfo = &prgn->paFramebuffers[uScreenId]; 1245 1245 1246 memset (&pFBInfo->dirtyRect, 0, sizeof (pFBInfo->dirtyRect));1246 RT_ZERO(pFBInfo->dirtyRect); 1247 1247 } 1248 1248 } -
trunk/src/VBox/Main/src-client/HGCM.cpp
r44528 r47117 243 243 m_hExtension (NULL) 244 244 { 245 memset (&m_fntable, 0, sizeof (m_fntable));245 RT_ZERO(m_fntable); 246 246 } 247 247 … … 290 290 if (RT_SUCCESS(rc)) 291 291 { 292 memset (&m_fntable, 0, sizeof (m_fntable));292 RT_ZERO(m_fntable); 293 293 294 294 m_fntable.cbSize = sizeof (m_fntable); … … 346 346 } 347 347 348 memset (&m_fntable, 0, sizeof (m_fntable));348 RT_ZERO(m_fntable); 349 349 m_pfnLoad = NULL; 350 350 m_hLdrMod = NIL_RTLDRMOD; -
trunk/src/VBox/Main/src-client/HGCMThread.cpp
r44528 r47117 221 221 m_handle (0) 222 222 { 223 memset (&m_critsect, 0, sizeof (m_critsect));223 RT_ZERO(m_critsect); 224 224 } 225 225 … … 307 307 { 308 308 Log(("hgcmThreadCreate: FAILURE: Can't init a critical section for a hgcm worker thread.\n")); 309 memset (&m_critsect, 0, sizeof (m_critsect));309 RT_ZERO(m_critsect); 310 310 } 311 311 } -
trunk/src/VBox/Main/src-client/RemoteUSBBackend.cpp
r44528 r47117 962 962 { 963 963 AssertFailed (); 964 memset (&mCritsect, 0, sizeof (mCritsect));964 RT_ZERO(mCritsect); 965 965 } 966 966 -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r47114 r47117 253 253 254 254 RT_ZERO(g_aszResolvConf); 255 RTStrmPrintf(g_aszResolvConf, MAX_PATH, "%/RESOLV2", _PATH_ETC);255 RTStrmPrintf(g_aszResolvConf, sizeof(g_aszResolvConf), "%/RESOLV2", _PATH_ETC); 256 256 # else 257 strcpy(g_aszResolvConf, "/etc/resolv.conf");257 RTStrCopy(g_aszResolvConf, sizeof(g_aszResolvConf), "/etc/resolv.conf"); 258 258 # endif 259 259 return g_aszResolvConf; -
trunk/src/VBox/Main/src-server/darwin/NetIf-darwin.cpp
r44742 r47117 86 86 87 87 struct ifreq IfReq; 88 strcpy(IfReq.ifr_name, pNew->szShortName);88 RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pNew->szShortName); 89 89 if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0) 90 90 { … … 392 392 { 393 393 struct ifreq IfReq; 394 strcpy(IfReq.ifr_name, pNew->szShortName);394 RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pNew->szShortName); 395 395 if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0) 396 396 { … … 512 512 513 513 struct ifreq IfReq; 514 strcpy(IfReq.ifr_name, pInfo->szShortName);514 RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pInfo->szShortName); 515 515 if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0) 516 516 { -
trunk/src/VBox/Main/src-server/darwin/iokit.cpp
r44528 r47117 374 374 CFIndex iCF; 375 375 } u; 376 memset(&u, 0, sizeof(u));376 RT_ZERO(u); 377 377 CFNumberType NumType = CFNumberGetType((CFNumberRef)pvValue); 378 378 if (CFNumberGetValue((CFNumberRef)pvValue, NumType, &u)) -
trunk/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
r44529 r47117 173 173 struct dev_match_result *paMatches = NULL; 174 174 175 memset(&DeviceCCB, 0, sizeof(union ccb));176 memset(&DeviceMatchPattern, 0, sizeof(struct device_match_pattern));175 RT_ZERO(DeviceCCB); 176 RT_ZERO(DeviceMatchPattern); 177 177 178 178 /* We want to get all devices. */ … … 237 237 unsigned iPeriphMatch = 0; 238 238 239 memset(&PeriphCCB, 0, sizeof(union ccb));240 memset(&PeriphMatchPattern, 0, sizeof(struct dev_match_pattern));241 memset(aPeriphMatches, 0, sizeof(aPeriphMatches));239 RT_ZERO(PeriphCCB); 240 RT_ZERO(PeriphMatchPattern); 241 RT_ZERO(aPeriphMatches); 242 242 243 243 /* This time we only want the specific nodes for the device. */ -
trunk/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
r44742 r47117 272 272 { 273 273 struct ifreq IfReq; 274 strcpy(IfReq.ifr_name, pNew->szShortName);274 RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pNew->szShortName); 275 275 if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0) 276 276 { … … 389 389 390 390 struct ifreq IfReq; 391 strcpy(IfReq.ifr_name, pInfo->szShortName);391 RTSTrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pInfo->szShortName); 392 392 if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0) 393 393 { -
trunk/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
r41528 r47117 267 267 268 268 struct usb_device_info UsbDevInfo; 269 memset(&UsbDevInfo, 0, sizeof(struct usb_device_info));269 RT_ZERO(UsbDevInfo); 270 270 271 271 rc = ioctl(FileUsb, USB_GET_DEVICEINFO, &UsbDevInfo); -
trunk/src/VBox/Main/src-server/generic/AutostartDb-generic.cpp
r44528 r47117 79 79 uint32_t cAutostartVms = 0; 80 80 81 memset(abBuf, 0, sizeof(abBuf));81 RT_ZERO(abBuf); 82 82 83 83 /* Check if the file was just created. */ -
trunk/src/VBox/Main/src-server/generic/NetIf-generic.cpp
r46345 r47117 381 381 return VERR_OUT_OF_RESOURCES; 382 382 struct ifreq Req; 383 memset(&Req, 0, sizeof(Req));384 strncpy(Req.ifr_name, pcszIfName, sizeof(Req.ifr_name) - 1);383 RT_ZERO(Req); 384 RTStrCopy(Req.ifr_name, sizeof(Req.ifr_name), pcszIfName); 385 385 if (ioctl(sock, SIOCGIFFLAGS, &Req) < 0) 386 386 { -
trunk/src/VBox/Main/src-server/linux/NetIf-linux.cpp
r46345 r47117 119 119 // memset(pInfo, 0, sizeof(*pInfo)); 120 120 struct ifreq Req; 121 memset(&Req, 0, sizeof(Req));122 strncpy(Req.ifr_name, pszName, sizeof(Req.ifr_name) - 1);121 RT_ZERO(Req); 122 RTStrCopy(Req.ifr_name, sizeof(Req.ifr_name), pszName); 123 123 if (ioctl(iSocket, SIOCGIFHWADDR, &Req) >= 0) 124 124 { … … 164 164 for (;;) 165 165 { 166 memset(szName, 0, sizeof(szName));166 RT_ZERO(szName); 167 167 int n = fscanf(fp, 168 168 "%08x%08x%08x%08x" … … 288 288 return VERR_OUT_OF_RESOURCES; 289 289 struct ifreq Req; 290 memset(&Req, 0, sizeof(Req));291 strncpy(Req.ifr_name, pcszIfName, sizeof(Req.ifr_name) - 1);290 RT_ZERO(Req); 291 RTStrCopy(Req.ifr_name, sizeof(Req.ifr_name), pcszIfName); 292 292 if (ioctl(sock, SIOCGIFHWADDR, &Req) >= 0) 293 293 { -
trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
r46326 r47117 594 594 595 595 /* Reset device state */ 596 memset(&Dev, 0, sizeof (Dev));596 RT_ZERO(Dev); 597 597 Dev.enmState = USBDEVICESTATE_UNUSED; 598 598 cHits = 1; -
trunk/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
r41528 r47117 321 321 } 322 322 323 memset(&PollFds, 0, sizeof(PollFds));323 RT_ZERO(PollFds); 324 324 PollFds[0].fd = RTFileToNative(mhFile); 325 325 PollFds[0].events = POLLIN; -
trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
r47001 r47117 205 205 { 206 206 struct lifreq IfReq; 207 strcpy(IfReq.lifr_name, szNICInstance);207 RTStrCopy(IfReq.lifr_name, sizeof(IfReq.lifr_name), szNICInstance); 208 208 if (ioctl(Sock, SIOCGLIFADDR, &IfReq) >= 0) 209 209 { … … 244 244 { 245 245 struct lifreq IfReq; 246 strcpy(IfReq.lifr_name, szNICInstance);246 RTStrCopy(IfReq.lifr_name, sizeof(IfReq.lifr_name), szNICInstance); 247 247 if (ioctl(Sock, SIOCGLIFADDR, &IfReq) >= 0) 248 248 { -
trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
r45367 r47117 955 955 { 956 956 NETIFINFO Info; 957 memset(&Info, 0, sizeof(Info));957 RT_ZERO(Info); 958 958 Info.Uuid = *(Guid(IfGuid).raw()); 959 959 rc = collectNetIfInfo(name, Guid(IfGuid), &Info, iDefaultInterface); -
trunk/src/VBox/Main/src-server/xpcom/server_module.cpp
r37666 r47117 54 54 #include <iprt/process.h> 55 55 #include <iprt/env.h> 56 #include <iprt/string.h> 56 57 #include <iprt/thread.h> 57 58 #include <string.h>59 58 60 59 #if defined(RT_OS_SOLARIS) … … 138 137 139 138 char msg[10]; 140 memset(msg, '\0', sizeof(msg));139 RT_ZERO(msg); 141 140 if ( PR_Read(readable, msg, sizeof(msg)-1) != 5 142 141 || strcmp(msg, "READY"))
Note:
See TracChangeset
for help on using the changeset viewer.