Project

General

Profile

Actions

Bug #318

closed

posterRead() may read garbage when a poster has never been written

Added by Anthony Mallet over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-

Description

The following code excerpt demonstrates the issue:

  char buf[42];
  POSTER_ID p;

  if (posterCreate("foo", sizeof(buf), &p) != OK)
    errx(2, "posterCreate");

  if (posterRead(p, 0, buf, sizeof(buf)) != sizeof(buf))
    errx(2, "posterRead");

  if (posterDelete(p) != OK)
    errx(2, "posterDelete");

The posterRead() will not fail, even though memory has never been initialized.

The attached patch will fix this.


Files

patch-localposterread.patch (876 Bytes) patch-localposterread.patch Anthony Mallet, 2021-06-07 22:53
Actions #1

Updated by Anthony Mallet over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Matthieu Herrb over 3 years ago

Ok matthieu@

Actions #3

Updated by Anthony Mallet over 3 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF