Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Bjørn Villa
qstream
Commits
5be06e74
Commit
5be06e74
authored
Jul 04, 2012
by
Jon Kåre Hellan
Browse files
Don't call init_stats from display_stats. Fixes use after free panic.
Debian package version 0.4-5
parent
f4061916
Changes
2
Hide whitespace changes
Inline
Side-by-side
debian/changelog
View file @
5be06e74
qstream (0.4-5) unstable; urgency=low
* Don't call init_stats from display_stats. Fixes use after free panic.
svn version r35.
-- Jon K Hellan <jon.kare.hellan@uninett.no> Wed, 04 Jul 2012 09:18:29 +0200
qstream (0.4-4) unstable; urgency=low
qstream (0.4-4) unstable; urgency=low
* Groups to poll taken from /etc/qstream/mpeg/poll.lst. svn version r33.
* Groups to poll taken from /etc/qstream/mpeg/poll.lst. svn version r33.
...
...
qstream
View file @
5be06e74
...
@@ -158,8 +158,14 @@ $SIG{INT} = sub { $uninterrupted=0; # return if $nint++ < 1;
...
@@ -158,8 +158,14 @@ $SIG{INT} = sub { $uninterrupted=0; # return if $nint++ < 1;
&
handle_threads
()
if
($
opt_tcp
and
$
opt_rtmp
);
&
handle_threads
()
if
($
opt_tcp
and
$
opt_rtmp
);
die
"End after interrupt.
\n
"
;
exit
(
0
)
};
die
"End after interrupt.
\n
"
;
exit
(
0
)
};
$
SIG
{
KILL
}
=
sub
{
$
uninterrupted
=
0
;
#
return
if
$
nkill
++
<
1
;
&
display_stats
();
die
"End after kill.
\n
"
;
exit
(
0
)
};
$
SIG
{
TERM
}
=
sub
{
$
uninterrupted
=
0
;
#
return
if
$
nkill
++
<
1
;
&
display_stats
();
&
end_xml
()
if
$
opt_xml
;
&
handle_threads
()
if
($
opt_tcp
and
$
opt_rtmp
);
die
"End after sigterm.
\n
"
;
exit
(
0
)
};
$
SIG
{
ALRM
}
=
sub
{
$
SIG
{
ALRM
}
=
sub
{
#
Writes
stats
to
file
if
option
XML
is
given
.
-
PMM
#
Writes
stats
to
file
if
option
XML
is
given
.
-
PMM
#
die
"No packets received"
if
$
n_packets
<
1
;
#
die
"No packets received"
if
$
n_packets
<
1
;
...
@@ -990,7 +996,7 @@ sub format_numbers{
...
@@ -990,7 +996,7 @@ sub format_numbers{
}
}
}
}
sub
xml_dump_rtmp_tcp
{
sub
xml_dump_rtmp_tcp
{
my
$
f
=
shift
;
my
$
f
=
$
_
[
0
];
#
*
Not
*
shift
.
This
gets
called
from
a
signal
handler
.
return
0
if
$
xml_printed
;
return
0
if
$
xml_printed
;
my
($
rtmp_jitter_stats
,$
rtmp_stats
,$
span
)
=
get_rtmp_data
()
if
$
opt_rtmp
;
my
($
rtmp_jitter_stats
,$
rtmp_stats
,$
span
)
=
get_rtmp_data
()
if
$
opt_rtmp
;
my
($
tcp_packet_stats
)
=
(\%
tcp_packet_stats
)
if
$
opt_tcp
;
my
($
tcp_packet_stats
)
=
(\%
tcp_packet_stats
)
if
$
opt_tcp
;
...
@@ -1150,7 +1156,7 @@ sub xml_new {
...
@@ -1150,7 +1156,7 @@ sub xml_new {
sub
xml_dump
{
sub
xml_dump
{
my
$
f
=
shift
;
my
$
f
=
$
_
[
0
];
#
*
Not
*
shift
.
This
gets
called
from
a
signal
handler
.
return
0
if
$
xml_printed
;
return
0
if
$
xml_printed
;
my
($
network_info
)
=
(\%
network_info
);
my
($
network_info
)
=
(\%
network_info
);
my
($
pcr_stats
,$
pts_stats
)
=
(\%
pcr_stats
,
\%
pts_stats
)
if
$
opt_mpeg
;
my
($
pcr_stats
,$
pts_stats
)
=
(\%
pcr_stats
,
\%
pts_stats
)
if
$
opt_mpeg
;
...
@@ -1736,7 +1742,7 @@ sub display_stats{
...
@@ -1736,7 +1742,7 @@ sub display_stats{
sub
print_out
{
sub
print_out
{
return
0
if
$
opt_rtmp
;
return
0
if
$
opt_rtmp
;
my
$
f
=
shift
;
my
$
f
=
$
_
[
0
];
#
*
Not
*
shift
.
This
gets
called
from
a
signal
handler
.
my
$
source
=$
f
;
my
$
source
=$
f
;
my
($
pts_stats
)
=
(\%
pts_stats
);
my
($
pts_stats
)
=
(\%
pts_stats
);
$
source
=$
source
{$
f
}
if
! $opt_v && $source{$f} ne "";
$
source
=$
source
{$
f
}
if
! $opt_v && $source{$f} ne "";
...
@@ -2065,7 +2071,6 @@ sub print_out {
...
@@ -2065,7 +2071,6 @@ sub print_out {
$
opt_nohead
=
1
;
$
opt_nohead
=
1
;
$
pdate
=$
date
;
$
pdate
=$
date
;
$
flow_pkts
{$
f
}=
0
;
$
flow_pkts
{$
f
}=
0
;
&
init_stats
($
f
);
}
}
sub
display_bins
{
sub
display_bins
{
print
"
\n\n
Bins "
;
print
"
\n\n
Bins "
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment