Fix NXDT_FILE_PROPERTIES_MAX_NAME_LENGTH validation
This commit is contained in:
parent
0848d43bc9
commit
1c6a7a094d
1 changed files with 1 additions and 1 deletions
|
@ -184,7 +184,7 @@ class NxdtUsbAbi1 {
|
||||||
final int fileNameLen = getLEint(message, 0x18);
|
final int fileNameLen = getLEint(message, 0x18);
|
||||||
String filename = new String(message, 0x20, fileNameLen, StandardCharsets.UTF_8);
|
String filename = new String(message, 0x20, fileNameLen, StandardCharsets.UTF_8);
|
||||||
|
|
||||||
if (fileNameLen == 0 || fileNameLen > NXDT_FILE_PROPERTIES_MAX_NAME_LENGTH){
|
if (fileNameLen <= 0 || fileNameLen > NXDT_FILE_PROPERTIES_MAX_NAME_LENGTH){
|
||||||
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
writeUsb(USBSTATUS_MALFORMED_REQUEST);
|
||||||
logPrinter.print("Invalid filename length!", EMsgType.FAIL);
|
logPrinter.print("Invalid filename length!", EMsgType.FAIL);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue