Skip to content

Commit

Permalink
fix potential buffer overflow?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaremy Creechley committed Nov 23, 2021
1 parent 33a66a9 commit 97b0e48
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/pure/net.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,7 @@ proc recvFrom*(socket: Socket, data: var string, length: int,
## function will make no effort to return it.
template adaptRecvFromToDomain(domain: Domain) =
var addrLen = sizeof(sockAddress).SockLen
data.setLen(length)
result = recvfrom(socket.fd, cstring(data), length.cint, flags.cint,
cast[ptr SockAddr](addr(sockAddress)), addr(addrLen))

Expand Down

0 comments on commit 97b0e48

Please sign in to comment.