Skip to content
Permalink
Browse files

Fixed buffer overflow when the netloader chunksize is too large, duri…

…ng NRO transfer (this will not occur with an unmodified nxlink).
  • Loading branch information...
yellows8 committed Aug 5, 2019
1 parent ce35f40 commit 6c84575ef790992101606921339d14c37dce5973
Showing with 6 additions and 0 deletions.
  1. +6 −0 common/netloader.c
@@ -304,6 +304,12 @@ static int decompress(int sock, FILE *fh, size_t filesize) {
return Z_DATA_ERROR;
}

if (chunksize > sizeof(in)) {
(void)inflateEnd(&strm);
netloader_error("Invalid chunk size.",0);
return Z_DATA_ERROR;
}

strm.avail_in = recvall(sock,in,chunksize,0);

if (strm.avail_in == 0) {

0 comments on commit 6c84575

Please sign in to comment.
You can’t perform that action at this time.