Fixed possible invalid program execution when in host mode if corrupt descriptor lengths are supplied by the attached device.
Minor code cleanups to add const and reformat where missing, as well as abstract out the internal device signature start address into a macro, so that it can be altered to suit particular devices within a single architecture if needed. Add missing documentation to the USB_Device_States_t enum.
This commit is contained in:
1 parent
78e58b6d1c
commit
049e930963
11 files changed
+67
-28
No files matched your search
@@ -32,8 +32,10 @@
|
||||
#include "ConfigDescriptor.h"
|
||||
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
uint8_t USB_Host_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const ConfigSizePtr,
|
||||
void* BufferPtr, uint16_t BufferSize)
|
||||
uint8_t USB_Host_GetDeviceConfigDescriptor(const uint8_t ConfigNumber,
|
||||
uint16_t* const ConfigSizePtr,
|
||||
void* const BufferPtr,
|
||||
const uint16_t BufferSize)
|
||||
{
|
||||
uint8_t ErrorCode;
|
||||
uint8_t ConfigHeader[sizeof(USB_Descriptor_Configuration_Header_t)];
|
||||
@@ -114,7 +116,9 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
|
||||
USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);
|
||||
}
|
||||
|
||||
uint8_t USB_GetNextDescriptorComp(uint16_t* const BytesRem, void** const CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine)
|
||||
uint8_t USB_GetNextDescriptorComp(uint16_t* const BytesRem,
|
||||
void** const CurrConfigLoc,
|
||||
const ConfigComparatorPtr_t const ComparatorRoutine)
|
||||
{
|
||||
uint8_t ErrorCode;
|
||||
|
||||
|
||||
Reference in new issue
Block a user