diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-18 08:35:39 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-18 08:38:15 +0200 |
commit | d0916ced78738053da54aeb65a48b6d7d2483107 (patch) | |
tree | f2949041fff47255bdf79f24d3739d1b8511999d /src/custom.c | |
parent | 80a7267f8c03a1c307b4f6b9bee1a906f53a0a01 (diff) | |
download | calcurse-d0916ced78738053da54aeb65a48b6d7d2483107.zip |
Initialize prompt buffers in the configuration menus
malloc() does not make sure that the buffer is initialized to contain
all zeros. Initialize the buffer with the empty string.
Reported-by: HÃ¥kan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/custom.c')
-rw-r--r-- | src/custom.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/custom.c b/src/custom.c index 607d026..f4cbfab 100644 --- a/src/custom.c +++ b/src/custom.c @@ -689,7 +689,10 @@ static void general_option_edit(int i) const char *periodic_save_str = _("Enter the delay, in minutes, between automatic saves (0 to disable) "); int val; - char *buf = malloc(BUFSIZ); + char *buf; + + buf = mem_malloc(BUFSIZ); + buf[0] = '\0'; switch (i) { case 0: |