repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
38ba806
)
LibCecSharp: fixed buffer overrun when copying libcec_configuration. fixes crash...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 8 May 2012 09:15:55 +0000
(11:15 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 8 May 2012 09:15:55 +0000
(11:15 +0200)
src/LibCecSharp/LibCecSharp.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/LibCecSharp/LibCecSharp.cpp
b/src/LibCecSharp/LibCecSharp.cpp
index 680ccfba6f2ffa51b549e145c202c1c78cb3a97f..fb723236eb0fa4fd3892dbc7b65c8ff3aa050d9f 100644
(file)
--- a/
src/LibCecSharp/LibCecSharp.cpp
+++ b/
src/LibCecSharp/LibCecSharp.cpp
@@
-91,7
+91,8
@@
namespace CecSharp
{
config.Clear();
{
config.Clear();
- _snprintf_s(config.strDeviceName, 13, context->marshal_as<const char*>(netConfig->DeviceName));
+ const char *strDeviceName = context->marshal_as<const char*>(netConfig->DeviceName);
+ memcpy_s(config.strDeviceName, 13, strDeviceName, 13);
for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
config.deviceTypes.types[iPtr] = (cec_device_type)netConfig->DeviceTypes->Types[iPtr];
for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
config.deviceTypes.types[iPtr] = (cec_device_type)netConfig->DeviceTypes->Types[iPtr];
@@
-128,7
+129,10
@@
namespace CecSharp
}
if (netConfig->ServerVersion >= CecServerVersion::Version1_6_2)
}
if (netConfig->ServerVersion >= CecServerVersion::Version1_6_2)
- _snprintf_s(config.strDeviceLanguage, 3, context->marshal_as<const char*>(netConfig->DeviceLanguage));
+ {
+ const char *strDeviceLanguage = context->marshal_as<const char*>(netConfig->DeviceLanguage);
+ memcpy_s(config.strDeviceLanguage, 3, strDeviceLanguage, 3);
+ }
config.callbacks = &g_cecCallbacks;
}
config.callbacks = &g_cecCallbacks;
}