#142 stats effect crashes with memory corruption

closed-fixed
nobody
None
5
2009-12-24
2009-09-16
No

The stats effect, as in
sox somefile.wav -n stats
e.g., tends to cause segmentation faults or glibc warnings and often simply hangs. This is apparently due to line 72 in stats.c:
memcpy(obuf, ibuf, len * sizeof(*olen));
As *olen is a size_t, it is 8 bytes long on my 64-bit system, while the size of one sample is only 4 bytes (32 bits). This leads to memcpy copying twice as much as was intended.

Perhaps what was meant was sizeof(*obuf)? Anyway, I attach a patch that changes it to sizeof(sox_sample_t). With this change, the stats effect works fine for me.

Discussion

  • Ulrich Klauer

    Ulrich Klauer - 2009-09-16

    Patch to stats effect

     
    Attachments
  • robs

    robs - 2009-09-16

    Thanks! Fix now in CVS.

     
  • Doug Cook

    Doug Cook - 2009-12-24
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks