#147 Segmentation fault while using MySQL backend

2.7.0
closed-fixed
opendkim (95)
6
2012-10-30
2012-10-30
ajacques
No

After upgrading to v2.7.0, OpenDKIM will immediately crash with a segmentation fault if I attempt to use MySQL for my back-end Key/Signing tables. Currently using OpenDBX v1.4.6 and Debian v6-squeeze.

Call stack:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77975fe in strlcpy (dst=0x7ffffffec250 "nDKIM/table=SigningKeys?keycol=id?datacol=domain_name,selector,private_key", src=0x0, size=1023) at strl.c:65
65 for (i = 0; i < size && (dst[i] = src[i]) != 0; i++)
(gdb) bt
#0 0x00007ffff77975fe in strlcpy (dst=0x7ffffffec280 "nDKIM/table=SigningKeys?keycol=id?datacol=domain_name,selector,private_key", src=0x0, size=1023) at strl.c:65
#1 0x000000000041ec50 in dkimf_db_walk (db=0x63f360, first=true, key=0x0, keylen=0x0, req=0x7ffffffe9cd0, reqnum=2) at opendkim-db.c:6006
#2 0x000000000040aa00 in dkimf_config_load (data=0x63f730, conf=0x63f010, err=0x7fffffffd9f0 "\230\275\327\366\377\177", errlen=1025) at opendkim.c:8196
#3 0x0000000000416c37 in main (argc=3, argv=0x7fffffffe718) at opendkim.c:16310

Discussion

  • A NULL returned from OpenDBX (representing a NULL in a row) wasn't being handled. It is now.

    However, the original report on the list suggests there wasn't a NULL in the table, so that part remains a mystery.

     
    • priority: 5 --> 6
    • assigned_to: nobody --> cm-msk
     
    • status: open --> closed-fixed
     
  • Fix for this bug included in new release.