Fixed bounds-check in netloader loadnro cmd-line args validation.

This commit is contained in:
yellows8 2019-12-10 12:14:23 -05:00
parent c2743dcdd5
commit 15baea1e44
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43

View File

@ -477,7 +477,7 @@ int loadnro(menuEntry_s *me, int sock, struct in_addr remote) {
}
if (response == 0 ) {
if (netloaded_cmdlen > sizeof(me->args.buf)-1) netloaded_cmdlen = sizeof(me->args.buf)-1;
if ((me->args.dst+netloaded_cmdlen) >= (char*)(me->args.buf + sizeof(me->args.buf))) netloaded_cmdlen = (uintptr_t)me->args.buf + sizeof(me->args.buf)-1 - (uintptr_t)me->args.dst;
len = recvall(sock,me->args.dst, netloaded_cmdlen,0);