Re: OT: snprintf() null termination

From: Gerardo Richarte (core.lists.exploit-dev@core-sdi.com)
Date: Thu May 30 2002 - 11:21:02 PDT

  • Next message: Russell Handorf: "Wireless MAC Addy question"

    Vanja Hrustic wrote:
    
    > So - do all platforms properly null-terminate string (on overflow) when
    > snprintf() is used, or one should still use "sizeof(string)-1" for the
    > size of the snprintf()-ed string?
    
        regarding snprintf():
    
        -Linux, Solaris and OpenBSD do terminate with NUL when not enough space is available
        -Windows does not (Microsoft's libraries, at least up to Visual Studio 6)
    
        the other OSes where not tested, but I guess most unixes will (just guessing)
    
        gera
    
    
    --- for a personal reply use: Gerardo Richarte <geraat_private>
    



    This archive was generated by hypermail 2b30 : Thu May 30 2002 - 12:22:09 PDT