NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: bin/38201: Potential lack of null termination when copying a string



    
    Since e->host is guaranteed to be longer than up->ut_host, and strncpy
    is used because up->ut_host might not be null terminated, the correct
    line would be:
        e->host[sizeof up->ut_host - 1] = 0;

i haven't looked at the code but this will truncate one byte
from ut_host (which is not a nul terminated string.)


.mrg.


Home | Main Index | Thread Index | Old Index