summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 624ea9f2a6..1df7cb988c 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -436,10 +436,12 @@ s_recvfrom(sock, argc, argv, from)
str = rb_tainted_str_new(0, buflen);
retry:
+ rb_str_locktmp(str);
rb_thread_wait_fd(fd);
TRAP_BEG;
slen = recvfrom(fd, RSTRING(str)->ptr, buflen, flags, (struct sockaddr*)buf, &alen);
TRAP_END;
+ rb_str_unlocktmp(str);
if (slen < 0) {
if (rb_io_wait_readable(fd)) {