Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breg: fix crash when setting regexwhere #451

Merged
merged 2 commits into from Mar 17, 2020

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
core/src/lib/breg.h Outdated Show resolved Hide resolved
@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.

None yet

2 participants