Skip to content

breg: fix crash when setting regexwhere#451

Merged
pstorz merged 2 commits intomasterfrom
dev/pstorz/master/fix-regexwhere-crash
Mar 17, 2020
Merged

breg: fix crash when setting regexwhere#451
pstorz merged 2 commits intomasterfrom
dev/pstorz/master/fix-regexwhere-crash

Conversation

@pstorz
Copy link
Member

@pstorz pstorz commented Mar 16, 2020

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

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
@franku franku force-pushed the dev/pstorz/master/fix-regexwhere-crash branch from 312da09 to 03c53d9 Compare March 17, 2020 11:12
@pstorz pstorz merged commit 54cb434 into master Mar 17, 2020
@pstorz pstorz deleted the dev/pstorz/master/fix-regexwhere-crash branch March 17, 2020 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants