View Issue Details

IDProjectCategoryView StatusLast Update
0000881bareos-core[All Projects] directorpublic2017-12-07 23:43
ReportercunioAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSDebianOS Version7
Product Version16.2.4 
Fixed in Version 
Summary0000881: B_DB::escape_object truncates output string
DescriptionIn B_DB::escape_object function in cats/cats.c file
bin_to_base64 is called with output buffer equal to encoded string but this function uses last byte for string termination
Returned encoded string is truncated by one character.
It produces truncated RestoreObject in database
It breaks restore job with percona plugin
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

joergs

joergs

2017-12-07 12:21

administrator   ~0002833

I've a quick look at the code, but didn't find an error. Can you give us more information? What database backend to you use?
cunio

cunio

2017-12-07 23:43

reporter   ~0002835

I use sqlite (builtin)
restore_object has size 141 bytes which gives 188 after base64
Only 187 bytes is stored in database
Look at line 137 in lib/base64.c buflen is 188 from
B_DB::db_escape_object in cats/cats.c
After this line is 187 but result needs 188

Issue History

Date Modified Username Field Change
2017-12-06 20:36 cunio New Issue
2017-12-07 12:21 joergs Note Added: 0002833
2017-12-07 12:21 joergs Status new => feedback
2017-12-07 23:43 cunio Note Added: 0002835
2017-12-07 23:43 cunio Status feedback => new