-
Type:
Bug
-
Status: Accepted
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 92 : 13 Mar
-
Labels:
There is something wrong with the backup code which ends up sending in a NULL-string to the strdup function. It then segfaults on the strlen function.
(gdb) bt
#0 0xb7b49323 in strlen () from /lib/tls/i686/cmov/libc.so.6
#1 0x08058d85 in allocator_strdup (allocator=0x8088138, string=0x0) at ../../../signer/src/shared/allocator.c:125
#2 0x08065b49 in zone_recover (zone=0x8088058) at ../../../signer/src/signer/zone.c:894
#3 0x08052078 in engine_recover (engine=0x807f288) at ../../../signer/src/daemon/engine.c:928
#4 0x08053928 in engine_start (cfgfile=0x80701eb "/etc/opendnssec/conf.xml", cmdline_verbosity=0, daemonize=0, info=0, single_run=0) at ../../../signer/src/daemon/engine.c:1049
#5 0x0804d0ed in main (argc=2, argv=0xbfdb9e24) at ../../../signer/src/ods-signerd.c:162
Should we add this extra check to avoid segfaults in the future?
Index: allocator.c
===================================================================
— allocator.c (revision 4584)
+++ allocator.c (working copy)
@@ -122,6 +122,9 @@
char*
allocator_strdup(allocator_type *allocator, const char *string)
{
+ if (!string)
return (char*) allocator_alloc_init(allocator, strlen(string) + 1, string);
}