2008-07-06 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/udp_tcl.c: Applied patch #1828920 (marttj) to prevent a
+ * tests/udp.test: crash calling udp_peek with wrong args.
+
* generic/udp_tcl.c: Applied patch #1838467 (marttj) to avoid a crash
* tests/udp.test: when exiting with an open mcast socket.
Tcl_Channel chan;
UdpState *statePtr;
+ if (argc < 2) {
+ Tcl_WrongNumArgs(interp, 0, NULL, "udp_peek sock ?buffersize?");
+ return TCL_ERROR;
+ }
chan = Tcl_GetChannel(interp, (char *)argv[1], NULL);
if (chan == (Tcl_Channel) NULL) {
return TCL_ERROR;
close $s
} -result {1 0}
+test udp-4.0 {udp_peek} -constraints unix -setup {
+ set s [udp_open]
+} -body {
+ udp_peek $s
+} -cleanup {
+ close $s
+} -result {FIX ME on a unix box}
+test udp-4.1 {udp_peek} -constraints unix -setup {
+ set s [udp_open]
+} -body {
+ udp_peek $s
+} -cleanup {
+ close $s
+} -result {FIX ME on a unix box}
+
+test udp-4.2 "udp_peek: bug #1828920 - args" -constraints unix -setup {
+ set s [udp_open]
+} -body {
+ udp_peek
+} -cleanup {
+ close $s
+} -returnCodes error -match glob -result {wrong num args: *}
test udp-10.1 "bug #1838467 - crash on exit" -setup {
set s [udp_open]