Skip to content
Permalink
Browse files

Fix filesys bug

Found by: michaelortmann
Patch by: michaelortmann

ed3a048#diff-f6d970b843b7d594745fbbeabf54dc71L448 where a buffer was changed from static len 1024 to nmalloc()ed len but s[256] = 0 left in place. After reading ed3a048#diff-f36d07cbe5f8b52e90f8c04ba0ec7af6 IRC discussion showed that guppy probably hosed it up and  s[256]=0 was probably left in place by mistake (<3 We miss you guppy!)
  • Loading branch information
michaelortmann authored and vanosg committed Nov 27, 2019
1 parent d902ef6 commit c46a9f89d0f9b95b7b9fb9ae89fa2bfc828e20f3
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/mod/filesys.mod/files.c
@@ -531,15 +531,16 @@ static void cmd_get(int idx, char *par)

static void cmd_file_help(int idx, char *par)
{
int l;
char *s;
struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };

get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.file->chat->con_chan);
if (par[0]) {
putlog(LOG_FILES, "*", "files: #%s# help %s", dcc[idx].nick, par);
s = nmalloc(strlen(par) + 9);
l = snprintf(NULL, 0, "filesys/%s", par);
s = nmalloc(l + 1);
sprintf(s, "filesys/%s", par);
s[256] = 0;
tellhelp(idx, s, &fr, 0);
my_free(s);
} else {

0 comments on commit c46a9f8

Please sign in to comment.
You can’t perform that action at this time.