[pkg-bacula-devel] Bug#1008978: bsdjson segmentation fault

Эрик Шахов jeshahov at astralinux.ru
Tue Apr 5 14:57:22 BST 2022


Package: bacula 
Version: 9.6.7-3 


Hi. 

Error message: bacula-sd: bsdjson.c:530-0 No Storage resource defined in /. Cannot continue. 05-апр 16:42 bacula-sd JobId 0: Error: bsdjson.c:530 No Storage resource defined in /. Cannot continue. bacula-sd: bsdjson.c:541-0 No Director resource defined in /. Cannot continue. 05-апр 16:42 bacula-sd JobId 0: Error: bsdjson.c:541 No Director resource defined in /. Cannot continue. bacula-sd: bsdjson.c:546-0 No Device resource defined in /. Cannot continue. 05-апр 16:42 bacula-sd JobId 0: Error: bsdjson.c:546 No Device resource defined in /. Cannot continue. 
Segmentation fault 

To reproduce the bug we just need to install bacula and type command "/usr/sbin/bsdjson /". This command will abort with "segmentation fault". In normal way it must finish without "Segmentation fault". 
System information: Linux debian 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64 GNU/Linux 
libc-2.31.so 

CWE identifier for this bug: CWE-476 NULL Pointer Dereference 

Code fragment where bug appearance: 

I n some moments program bsdjson call function check_resources(bsdjson.c:521). In if(! me->messages ) ( file bsdjson . c : 551 ) and if(! me->working_directory) ( file bsdjson . c : 560 ) because of NULL Pointer Dereference appearance undefined program behavior. In this bug - «Segmentation fault» 

Way to fix this bug: 

Problem can be solved by correcting «if». For example: 

if( me && !me→messages) 

f( me && ! me->working_directory) 
Regards, 

Shahov Erik 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-bacula-devel/attachments/20220405/16f34290/attachment.htm>


More information about the pkg-bacula-devel mailing list