Re: Windows absolute drive path detection incomplete

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

 



On Thu, Aug 8, 2019 at 12:45 PM Christopher Ertl
<Christopher.Ertl@xxxxxxxxxxxxx> wrote:
> So I'm proposing to remove the check for the drive letter being alpha in `has_dos_drive_prefix` macro:
>
> #define has_dos_drive_prefix(path) \
>         ( (path)[1] == ':' ? 2 : 0)

Nit: This isn't safe and will access memory beyond end-of-string if
path is zero-length. Perhaps something like this would be better:

    #define has_dos_drive_prefix(path) \
        (*(path) && (path)[1] == ':' ? 2 : 0)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux