Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 60f3b9d7e16272852753532aeb7eefea16ee4fb2
Ticket: 1259431fffffffffffffffffffffffffffffffff
Check for 0 byte allocation in ckalloc
User & Date: hobbs on 2005-08-16 00:19:22
Changes

  1. icomment:
    Logged In: YES 
    user_id=72656
    
    We certainly shouldn't panic on 0 alloc requests - that is
    perfectly valid in the C standard.  I see where Mo is
    requesting the patch we do seem to have a latent bug in that
    we shouldn't panic on (result == NULL) unless (size != 0),
    as AIX and some other systems do return NULL for 0-byte allocs.
    
    If a crash occured in the mingw compile, than I would
    backtrack to the sources making the alloc, as
    ckalloc(0)/malloc(0) is valid C.  We did have to correct
    code in tkImg*.c once regarding this (0 size image allocs)
    because we simply weren't handling the case of such requests
    - which was a bug in the image code, not in ckalloc(0) per se.
    
    
  2. login: "hobbs"
  3. mimetype: "text/plain"
  4. username: "hobbs"