Did you put in pastebin the wrong file (like dlg_db_handlers.c)?
All the tokens provided by kamailio in that log message are by length and pointer (%.*s), so there should be no strlen done on the pointers we set, so not sure on what syslog can do the strlen and crash.