From: Alain Spineux Date: Tue, 11 Jul 2023 10:25:20 +0000 (+0200) Subject: Fix the selection list bug with jobid=1-2277 X-Git-Tag: Beta-15.0.0~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c485def4d98e586dd6b0da0a2c697a52e0371d58;p=thirdparty%2Fbacula.git Fix the selection list bug with jobid=1-2277 - must take in account '\0' AND ',' --- diff --git a/bacula/src/lib/sellist.c b/bacula/src/lib/sellist.c index 8de738669..6c6a38a82 100644 --- a/bacula/src/lib/sellist.c +++ b/bacula/src/lib/sellist.c @@ -188,8 +188,8 @@ char *sellist::get_expanded_list() edit_int64(val, ed1); len = strlen(ed1); - /* Alloc more space if needed */ - if ((p + len + 1) > (expanded + expandedsize)) { + /* Alloc more space if needed ( '2' because of '\0' & ',')*/ + if ((p + len + 2) > (expanded + expandedsize)) { expandedsize = expandedsize * 2; tmp = (char *) realloc(expanded, expandedsize);