importstats segfault

From: Andreas Schulze <sca_at_andreasschulze.de>
Date: Wed, 14 Dec 2011 08:47:48 +0100

good morning,

opendkim-spam creates update-records like that:
--- head -n 2
V3
U35F8B2E27 taro 0 1

if piped to opendkim-importstats, the spamstate of msgid 35F8B2E27 will be updated.
But if 35F8B2E27 doeas not exist in the database, it segfaults.

read(0, "V3\nU35F8B2E27\ttaro\t0\t1\n"..., 4096) = 23
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "-\0\0\0\3SELECT id FROM reporters WHE"..., 49) = 49
read(3, "\1\0\0\1\0014\0\0\2\3def\10opendkim\treporters\t"..., 16384) = 85
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "H\0\0\0\3SELECT MAX(id) FROM messages"..., 76) = 76
read(3, "\1\0\0\1\1\35\0\0\2\3def\0\0\0\7MAX(id)\0\f?\0\n\0\0\0\3"..., 16384) = 61
--- SIGSEGV (Segmentation fault) _at_ 0 (0) ---
+++ killed by SIGSEGV +++

# the sqllog:
111214 8:43:28 202 Connect opendkim_at_localhost on opendkim
                  202 Query SET SESSION sql_mode='ANSI'
                  202 Query SELECT id FROM reporters WHERE name = 'taro'
                  202 Query SELECT MAX(id) FROM messages WHERE jobid = '35F8B2E27' AND reporter = 1

# and the same queries in mysql
mysql> SELECT id FROM reporters WHERE name = 'taro'
    -> ;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)

mysql> SELECT MAX(id) FROM messages WHERE jobid = '35F8B2E27' AND reporter = 1;
+---------+
| MAX(id) |
+---------+
| NULL |
+---------+
1 row in set (0.00 sec)

hope, that helps ...
Andreas

-- 
########################################################################
#
# Andreas Schulze
# https://andreasschulze.de
# 
# GnuPG Key-ID: A7DBA67F, https://andreasschulze.de/sca.asc
# GnuPG Fingerprint: 14C1 39A8 CE6D 6BE0 28C6 5652 03B5 6793 A7DB A67F
#
# $Id: .signature,v 1.3 2007-12-27 21:13:36 sca Exp $
########################################################################
Received on Wed Dec 14 2011 - 07:47:57 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:33:14 PST