Skip to content
Snippets Groups Projects
Commit 72245fc6 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Ensure ndof product string is null terminate

parent dfb80631
No related branches found
No related tags found
No related merge requests found
...@@ -475,7 +475,10 @@ void LLViewerJoystick::initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8 ...@@ -475,7 +475,10 @@ void LLViewerJoystick::initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8
#if LIB_NDOF #if LIB_NDOF
mLastDeviceUUID = guid; mLastDeviceUUID = guid;
strncpy(mNdofDev->product, name.c_str(), sizeof(mNdofDev->product)); size_t dest_size = sizeof(mNdofDev->product);
strncpy(mNdofDev->product, name.c_str(), dest_size-1);
mNdofDev->product[dest_size] = '\0';
mNdofDev->manufacturer[0] = '\0'; mNdofDev->manufacturer[0] = '\0';
initDevice(preffered_device); initDevice(preffered_device);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment