Changeset bbfa9d88f2605be30b995b213815fd5e82cda5b3

Show
Ignore:
Timestamp:
28/12/07 17:16:55 (10 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1198858615 +0000
git-parent:

[781ebbeb0613179456b0c60d383d6e4b0e794742]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1198858615 +0000
Message:

Fix stack overflow in debug code: use heap for large allocations.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/file.c

    r7d02052 rbbfa9d8  
    204204 
    205205# ifdef HAVE_MMAP 
    206 # ifndef __APPLE__ 
    207206    p_sys->pagemask = sysconf (_SC_PAGE_SIZE) - 1; 
    208207 
     
    225224        msg_Dbg (p_this, "mmap disabled (non regular file)"); 
    226225# endif 
    227 # endif 
    228226#else 
    229227    p_sys->b_seekable = !b_stdin; 
     
    441439#ifndef NDEBUG 
    442440    /* Compare normal I/O with memory mapping */ 
    443     char buf[block->self.i_buffer]
     441    char *buf = malloc (block->self.i_buffer)
    444442    ssize_t i_read = read (p_sys->fd, buf, block->self.i_buffer); 
    445443 
     
    449447    if (memcmp (buf, block->self.p_buffer, block->self.i_buffer)) 
    450448        msg_Err (p_access, "inconsistent data buffer"); 
     449    free (buf); 
    451450#endif 
    452451