[dspam-users] Divide by zero in hash_drv.c (3.6.0-STABLE)

From: Frank Denis \(Jedi/Sector One\) <dspam@pureftpd.org>
Date: Mon Oct 17 2005 - 09:24:41 EDT

  Hello,
  
  After a while, I got a lot of divide by zero errors with dspam 3.6.0,
using the hash driver. Here's a traceback:

#0 0x1c021277 in __umoddi3 (u=8851445063336151346, v=1)
    at /var/extra/src/gnu/usr.bin/gcc/gcc/libgcc2.c:551
#1 0x1c020a08 in _hash_drv_seek (map=0x8b91c800, offset=1600036,
    hashcode=8851445063336151346, flags=0) at hash_drv.c:1018
#2 0x1c020cb7 in _hash_drv_get_spamrecord (map=0x8b91c800, wrec=0xcfbdb390)
    at hash_drv.c:1104
#3 0x1c01fa29 in _ds_get_spamrecord (CTX=0x7e3a0800,
    token=8851445063336151346, stat=0xcfbdb3e0) at hash_drv.c:631
#4 0x1c01f7d8 in _ds_getall_spamrecords (CTX=0x7e3a0800, diction=0x7e958380)
    at hash_drv.c:551
#5 0x1c0130cb in _ds_operate (CTX=0x7e3a0800,
    headers=0x83177000 "Return-Path: <0616710792@imode.fr>",
    body=0x84d4b400 "Merci") at libdspam.c:832
#6 0x1c01297d in dspam_process (CTX=0x7e3a0800,
    message=0x7cd0b000 "Return-Path: <0616710792@imode.fr>\nReceived: from enterprise.orbus.fr ([unix socket])\n\tby enterprise.orbus.fr (Cyrus v2.0.17); Mon, 17 Oct 2005 15:19:27 +0200\nX-Sieve: cmu-sieve 2.0\nReceived: from loc"...)
    at libdspam.c:579
#7 0x1c002a26 in process_message (ATX=0xcfbdd8ec, message=0x86477da0,
    username=0x86477430 "j", result_string=0xcfbdd2cc) at dspam.c:500
#8 0x1c00572a in process_users (ATX=0xcfbdd8ec, message=0x86477b60)
    at dspam.c:1737
#9 0x1c0022e9 in main (argc=6, argv=0xcfbde368) at dspam.c:241

  The bug seems to be here:
  
fpos = sizeof(struct _hash_drv_header) +
    ((hashcode % header->hash_rec_max) * sizeof(struct _hash_drv_spam_record));
    
  For a strange reason header->hash_rec_max is zero.
Received on Mon Oct 17 09:25:35 2005

This archive was generated by hypermail 2.1.8 : Tue Oct 18 2005 - 00:00:00 EDT