Project

General

Profile

Actions

Bug #13681

closed

libfruraw: writing 1 byte into a region of size 0

Added by Toomas Soome about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build error with gcc 10:

../fruraw.c: In function 'frt_get_segment_name':
../fruraw.c:552:41: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  552 |     segs[each_seg].name[FRU_SEGNAMELEN] = '\0';
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from ../fru_access_impl.h:50,
                 from ../fruraw.c:32:
../fru_access.h:62:7: note: at offset 2 to object 'name' with size 2 declared here
   62 |  char name[SEG_NAME_LEN]; /*  from container section header  */
      |       ^~~~

This issue is about writing past array end.

Testing done: build/install/boot

Actions #1

Updated by Electric Monk about 2 months ago

  • Gerrit CR set to 1375
Actions #2

Updated by Electric Monk about 2 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 3bbba396f8599b5a3225ae7d8bb0119abdfaa427

commit  3bbba396f8599b5a3225ae7d8bb0119abdfaa427
Author: Toomas Soome <tsoome@me.com>
Date:   2021-03-30T21:08:29.000Z

    13681 libfruraw: writing 1 byte into a region of size 0
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF