From: Nathan F. <nf...@us...> - 2012-09-05 02:45:29
|
The branch "master" has been updated in SBCL: via 9d17f7daef6d930a229ae6c0339c9eefc3dd71e6 (commit) from c8ef1a3b83ce08f35ee3e481eb334decc837d214 (commit) - Log ----------------------------------------------------------------- commit 9d17f7daef6d930a229ae6c0339c9eefc3dd71e6 Author: Nathan Froyd <fr...@gm...> Date: Tue Sep 4 22:45:03 2012 -0400 make SOCKET-RECEIVE work correctly when receiving overly-long UDP packets Only copy as much data as the provided buffer can hold. Continue to return the length provided from recvfrom as per documentation. Fixes lp#1023438. Thanks to Robert Uhl for the fix. --- NEWS | 3 +++ contrib/sb-bsd-sockets/sockets.lisp | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index 47be00e..a858d46 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ changes relative to sbcl-1.0.58: comparisons, particularly on almost-sorted inputs. * bug fix: Reading floats with large exponents no longer takes too much time before reporting that the exponent is too large. + * bug fix: SB-BSD-SOCKETS:SOCKET-RECEIVE with a UDP socket now works + correctly when the received datagram is larger than the provided buffer. + (lp#1023438, thanks to Robert Uhl) * documentation: a section on random number generation has been added to the manual. (lp#656839) diff --git a/contrib/sb-bsd-sockets/sockets.lisp b/contrib/sb-bsd-sockets/sockets.lisp index 9118a6a..5d09d65 100644 --- a/contrib/sb-bsd-sockets/sockets.lisp +++ b/contrib/sb-bsd-sockets/sockets.lisp @@ -229,7 +229,7 @@ buffer was too small.")) (list sockint::EAGAIN sockint::EINTR))) nil) ((= len -1) (socket-error "recvfrom")) - (t (loop for i from 0 below len + (t (loop for i from 0 below (min len length) do (setf (elt buffer i) (cond ((or (eql element-type 'character) (eql element-type 'base-char)) ----------------------------------------------------------------------- hooks/post-receive -- SBCL |