The filepath constructor that takes a const char * is missing the
initializer for the encoded member. This results in uninitialized
memory, so the encoded field is sometimes true, resulting in mds
crashes (see #3186) and client errors with empty components in path
names. This commit fixes #3186 and #2285.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
* if we are fed a relative path as a string, either set ino=0 (strictly
* relative) or 1 (absolute). throw out any leading '/'.
*/
- filepath(const char *s) {
+ filepath(const char *s) : encoded(false) {
set_path(s);
}
void set_path(const char *s) {