bareos: master b0cb4ef3

Author Committer Branch Timestamp Parent
pstorz pstorz master 2020-03-16 13:35 master 3c3f50e8 Pending
Affected Issues  0001211: bareos director and bareos fd crash when regexwhere is specified
Changeset breg: fix crash when manually setting regexwhere

When manually setting the regular expression during restore like with:

OK to run? (yes/mod/no): mod
->11: File Relocation
->4: Enter a regexp
->Please enter a valid regexp (!from!to!): !what!with!
->6: Use this ?

The director crashed. This happens because the member regex_t preg of
the class BareosRegex was not zero initialized correctly.
This caused the freeing of random memory in void regfree(regex_t* preg).

Now all members of class BareosRegex are zero initialized and the
problem is fixed.

This problem also causes the filedaemon to crash when regexwhere is specified
in the restore job configuration. On the second restore run the filedaemon
crashes.

Fixes# 1211: bareos director and bareos fd crash when regexwhere is specified
mod - core/src/lib/breg.h Diff File