Fixed potential buffer overflow in updatestatus
This commit is contained in:
parent
0068619a3c
commit
dbace38b2a
|
@ -4,9 +4,6 @@
|
||||||
/* buffer size for capturing output of the programs used for updating blocks */
|
/* buffer size for capturing output of the programs used for updating blocks */
|
||||||
#define CMDOUTLENGTH 50
|
#define CMDOUTLENGTH 50
|
||||||
|
|
||||||
/* buffer size for status text */
|
|
||||||
#define STATUSLENGTH 256
|
|
||||||
|
|
||||||
/* DELIMITERENDCHAR must be less than 32.
|
/* DELIMITERENDCHAR must be less than 32.
|
||||||
* At max, DELIMITERENDCHAR - 1 number of clickable blocks are allowed.
|
* At max, DELIMITERENDCHAR - 1 number of clickable blocks are allowed.
|
||||||
* Raw characters larger than DELIMITERENDCHAR and smaller than ' ' in ASCII
|
* Raw characters larger than DELIMITERENDCHAR and smaller than ' ' in ASCII
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#define LOCKFILE "/tmp/dwmblocks.pid"
|
#define LOCKFILE "/tmp/dwmblocks.pid"
|
||||||
|
|
||||||
#define DELIMITERLENGTH sizeof delimiter
|
#define DELIMITERLENGTH sizeof delimiter
|
||||||
|
#define STATUSLENGTH ((sizeof blocks / sizeof blocks[0]) * (CMDOUTLENGTH + DELIMITERLENGTH))
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
@ -239,7 +240,7 @@ updateblock(Block *block, int sigval)
|
||||||
void
|
void
|
||||||
updatestatus()
|
updatestatus()
|
||||||
{
|
{
|
||||||
static char statustext[STATUSLENGTH + DELIMITERLENGTH];
|
static char statustext[STATUSLENGTH];
|
||||||
char *s = statustext;
|
char *s = statustext;
|
||||||
Block *block;
|
Block *block;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue