mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 02:11:04 +02:00
dboxinfo: fix buffer size, avoid overflow
Origin commit data
------------------
Commit: a91a27900c
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-12-26 (Fri, 26 Dec 2014)
This commit is contained in:
@@ -392,14 +392,14 @@ void CDBoxInfoWidget::paint()
|
|||||||
upminutes %= 60;
|
upminutes %= 60;
|
||||||
|
|
||||||
if (updays) {
|
if (updays) {
|
||||||
snprintf(ubuf, sizeof(sbuf), "%d day%s, ", updays, (updays != 1) ? "s" : "");
|
snprintf(ubuf, sizeof(ubuf), "%d day%s, ", updays, (updays != 1) ? "s" : "");
|
||||||
strcat(sbuf, ubuf);
|
strcat(sbuf, ubuf);
|
||||||
}
|
}
|
||||||
if (uphours) {
|
if (uphours) {
|
||||||
snprintf(ubuf, sizeof(sbuf), "%d hour%s, ", uphours, (uphours != 1) ? "s" : "");
|
snprintf(ubuf, sizeof(ubuf), "%d hour%s, ", uphours, (uphours != 1) ? "s" : "");
|
||||||
strcat(sbuf, ubuf);
|
strcat(sbuf, ubuf);
|
||||||
}
|
}
|
||||||
snprintf(ubuf,sizeof(sbuf), "%d minute%s", upminutes, (upminutes != 1) ? "s" : "");
|
snprintf(ubuf,sizeof(ubuf), "%d minute%s", upminutes, (upminutes != 1) ? "s" : "");
|
||||||
strcat(sbuf, ubuf);
|
strcat(sbuf, ubuf);
|
||||||
|
|
||||||
snprintf(ubuf, sizeof(ubuf), "%s: ", g_Locale->getText(LOCALE_EXTRA_DBOXINFO_LOAD));
|
snprintf(ubuf, sizeof(ubuf), "%s: ", g_Locale->getText(LOCALE_EXTRA_DBOXINFO_LOAD));
|
||||||
|
Reference in New Issue
Block a user