]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix the selection list bug with jobid=1-2277
authorAlain Spineux <alain@baculasystems.com>
Tue, 11 Jul 2023 10:25:20 +0000 (12:25 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:01 +0000 (13:57 +0200)
- must take in account '\0' AND ','

bacula/src/lib/sellist.c

index 8de738669981efa38015b8d9d7b795d8a82209b1..6c6a38a8261f6b191fca70c6957c25a521478c41 100644 (file)
@@ -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);