ffserver: fix potential buffer overflow, based on wrong fscanf format indentifier.
Fixed Ticket1780
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f077e1fb4c
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
e21a53b6eb
commit
ce433996d7
@@ -2034,7 +2034,7 @@ static void compute_status(HTTPContext *c)
|
|||||||
char cpuperc[10];
|
char cpuperc[10];
|
||||||
char cpuused[64];
|
char cpuused[64];
|
||||||
|
|
||||||
if (fscanf(pid_stat, "%10s %64s", cpuperc,
|
if (fscanf(pid_stat, "%9s %63s", cpuperc,
|
||||||
cpuused) == 2) {
|
cpuused) == 2) {
|
||||||
avio_printf(pb, "Currently using %s%% of the cpu. Total time used %s.\n",
|
avio_printf(pb, "Currently using %s%% of the cpu. Total time used %s.\n",
|
||||||
cpuperc, cpuused);
|
cpuperc, cpuused);
|
||||||
|
Reference in New Issue
Block a user