Project

General

Profile

Actions

Bug #13650

closed

sendmail: writing 1 byte into a region of size 0

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Build errors on SPARC with gcc 10:

    daemon.c: In function 'anynet_ntoa':
    daemon.c:4369:8: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
     4369 |  *--bp = '\0';
          |  ~~~~~~^~~~~~
    daemon.c:4314:14: note: at offset -1 to object 'buf' with size 100 declared here
     4314 |  static char buf[100];
          |              ^~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `daemon.o'
    Current working directory /code/illumos-gate/usr/src/cmd/sendmail/src

This error is trying to tell us, we have potential write past array end. I'm not exactly sure why we do not get this on x86 (gcc 10.1 on sparc and 10.2 on x86). Patch is result of iteration with upstream.

Testing done: build is ok.

Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1354
Actions #2

Updated by Electric Monk about 1 year ago

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

git commit 91b4b5393fe18d32505f967d482b81eef7f68d22

commit  91b4b5393fe18d32505f967d482b81eef7f68d22
Author: Toomas Soome <tsoome@me.com>
Date:   2021-03-30T20:18:04.000Z

    13650 sendmail: writing 1 byte into a region of size 0
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF