• [^] # Re: criticité

    Posté par . En réponse au journal Genèse d'un journal. Évalué à 7.

    Pour info, voici le code d'openssh [1] :

    void *
    xmalloc(size_t size)
    {
     void *ptr;
     if (size == 0)
     fatal("xmalloc: zero size");
     ptr = malloc(size);
     if (ptr == NULL)
     fatal("xmalloc: out of memory (allocating %lu bytes)", (u_long) size);
     return ptr;
    }
    [...]
    /* Fatal messages. This function never returns. */
    void
    fatal(const char *fmt,...)
    {
     va_list args;
     va_start(args, fmt);
     do_log(SYSLOG_LEVEL_FATAL, fmt, args);
     va_end(args);
     cleanup_exit(255);
    }
    [...]
    /* default implementation */
    void
    cleanup_exit(int i)
    {
     _exit(i);
    }
    
    

    [1] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/