Re: [PATCH libdrm] xf86drm: fix null termination of string buffer

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

 



Hi Taro Yamada,

On 13 December 2016 at 11:18,  <archer_ame@xxxxxxxxxxx> wrote:
> From: Taro Yamada <archer_ame@xxxxxxxxxxx>
>
> The string written to the buffer by read() is not null-terminated,
> but currently drmParsePciBusInfo() places null character only at the end of the buffer, not at the end of the
> string.
> As a result, the string passed to sscanf() contains an uninitialized value.
>
> This patch changes to places null character at the end of the string.
>
Did you see this causing issues in practise ?

We use a combination of strstr to strip any unwanted starting data,
and sscanf which [should] trim any trailing garbage.
That aside, your patch provides an extra bit of robustness which is
always nice ^_^

Reviewed-by: Emil Velikov <emil.l.velikov@xxxxxxxxx>

Barring any objections I'll commit this in a few days.

Thanks
Emil
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux