BTW: this is a serious bug in the specific network card driver of this report, it returned a buffer length LONGER than the provided buffer length one!
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20923
f5534014-38df-0310-8fa8-
9805f1628bb7
+ /* get a buffer suitable for PacketRequest() */
OidData=GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,IoCtlBufferLength);
if (OidData == NULL) {
OidData=GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,IoCtlBufferLength);
if (OidData == NULL) {
- g_warning("packet_link_status failed\n");
+ g_warning("GlobalAllocPtr failed for %u\n", IoCtlBufferLength);
Status = p_PacketRequest(adapter, set, OidData);
if(Status) {
Status = p_PacketRequest(adapter, set, OidData);
if(Status) {
- g_assert(OidData->Length <= *length);
- memcpy(value, OidData->Data, OidData->Length);
- *length = OidData->Length;
+ if(OidData->Length <= *length) {
+ /* copy value from driver */
+ memcpy(value, OidData->Data, OidData->Length);
+ *length = OidData->Length;
+ } else {
+ /* the driver returned a value that is longer than expected (and longer than the given buffer) */
+ g_warning("returned oid too long, Oid: 0x%x OidLen:%u MaxLen:%u", Oid, OidData->Length, *length);
+ Status = FALSE;
+ }
}
GlobalFreePtr (OidData);
}
GlobalFreePtr (OidData);