Re: [PATCH] sparc_attrs.c: Prevent buffer overflow in sparc_check_object_attribute

2024-11-05 Thread Mark Wielaard
Hi, On Tue, Nov 05, 2024 at 11:58:19AM -0500, Serhei Makarov wrote: > On Tue, Nov 5, 2024, at 9:25 AM, Anton Moryakov wrote: > > Record Length Limit: We use strncat to add a line indicating the > > available remaining_size. This prevents writing beyond the allocated > > memory. > > Remaining spa

Re: [PATCH] sparc_attrs.c: Prevent buffer overflow in sparc_check_object_attribute

2024-11-05 Thread Serhei Makarov
On Tue, Nov 5, 2024, at 9:25 AM, Anton Moryakov wrote: > Record Length Limit: We use strncat to add a line indicating the > available remaining_size. This prevents writing beyond the allocated > memory. > Remaining space update: remaining_size is updated after each entry to > ensure that row

[PATCH] sparc_attrs.c: Prevent buffer overflow in sparc_check_object_attribute

2024-11-05 Thread Anton Moryakov
first report of the static analyzer: A string is copied into the buffer 's' of size 577 without checking its length first at sparc_attrs.c:95. Corrections explained: Record Length Limit: We use strncat to add a line indicating the available remaining_size. This prevents writing beyond the alloc