]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ipc: avoid potential stack-not-refcounted bug
authorEric Wong <e@80x24.org>
Tue, 25 May 2021 22:20:00 +0000 (22:20 +0000)
committerEric Wong <e@80x24.org>
Tue, 25 May 2021 23:05:02 +0000 (23:05 +0000)
This fixes a potential problem with Carp::longmess
firing somewhere deeper in the stack.  This is not a known
problem at this time, but something I noticed while chasing
something else.

lib/PublicInbox/IPC.pm

index cf3723f764b9f3c84b33a8bdf2993a117ec75e63..24237773903373ca63f3b0783da537b678a841b8 100644 (file)
@@ -251,7 +251,7 @@ sub wq_worker_loop ($) {
 
 sub do_sock_stream { # via wq_io_do, for big requests
        my ($self, $len) = @_;
 
 sub do_sock_stream { # via wq_io_do, for big requests
        my ($self, $len) = @_;
-       recv_and_run($self, delete $self->{0}, $len, 1);
+       recv_and_run($self, my $s2 = delete $self->{0}, $len, 1);
 }
 
 sub wq_broadcast {
 }
 
 sub wq_broadcast {