Skip to content
Snippets Groups Projects
Commit f0ebd374 authored by Leif Stensson's avatar Leif Stensson
Browse files

Added error check to avoid fatal error when trying to read from an

uninitialized UDP object.

Rev: src/modules/files/udp.c:1.17
parent 7ccb473c
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: udp.c,v 1.16 2000/10/12 20:22:57 mirar Exp $ * $Id: udp.c,v 1.17 2000/10/24 12:25:27 leif Exp $
*/ */
#define NO_PIKE_SHORTHAND #define NO_PIKE_SHORTHAND
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "file_machine.h" #include "file_machine.h"
RCSID("$Id: udp.c,v 1.16 2000/10/12 20:22:57 mirar Exp $"); RCSID("$Id: udp.c,v 1.17 2000/10/24 12:25:27 leif Exp $");
#include "fdlib.h" #include "fdlib.h"
#include "interpret.h" #include "interpret.h"
#include "svalue.h" #include "svalue.h"
...@@ -331,6 +331,8 @@ void udp_read(INT32 args) ...@@ -331,6 +331,8 @@ void udp_read(INT32 args)
} }
pop_n_elems(args); pop_n_elems(args);
fd = FD; fd = FD;
if (FD < 0)
error("UDP: not open\n");
do { do {
THREADS_ALLOW(); THREADS_ALLOW();
res = fd_recvfrom(fd, buffer, UDP_BUFFSIZE, flags, res = fd_recvfrom(fd, buffer, UDP_BUFFSIZE, flags,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment