Fixed buffer overflow vuln with netloader args introduced with the original netloader commit. Fixed unrelated bounds check in launchAddArg() which assumed there was nothing after argData_s.buf within argData_s, which was no longer the case once nxlink_host was added to argData_s.
This commit is contained in:
parent
1435a2fb3b
commit
d616ed02a7
@ -2,7 +2,7 @@
|
||||
|
||||
size_t launchAddArg(argData_s* ad, const char* arg) {
|
||||
size_t len = strlen(arg)+1;
|
||||
if ((ad->dst+len) >= (char*)(ad+1)) return len; // Overflow
|
||||
if ((ad->dst+len) >= (char*)(ad->buf + sizeof(ad->buf))) return len; // Overflow
|
||||
ad->buf[0]++;
|
||||
strcpy(ad->dst, arg);
|
||||
ad->dst += len;
|
||||
|
@ -464,6 +464,8 @@ 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;
|
||||
|
||||
len = recvall(sock,me->args.dst, netloaded_cmdlen,0);
|
||||
|
||||
if (len != netloaded_cmdlen) {
|
||||
|
Loading…
Reference in New Issue
Block a user