Project

General

Profile

Actions

Bug #5588

closed

invalid use of NULL in itm_util.c

Added by Richard PALO over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-02-04
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

In c, uintptr_t is defined as

an unsigned integer type with the property that any valid pointer to void can be
converted to this type, then converted back to pointer to void, and the result will 
compare equal to the original pointer

so in this construct:

               tbl->name.itm_ptr = NULL;

Assigning NULL directly is inproper, it should be casted.

Also, NULL is meaningless for an enum's value, so the attached patch
fixes these.


Files

Actions #3

Updated by Gary Mills over 8 years ago

  • Status changed from New to Feedback

This change looks correct to me. I'd say it's ready for a review request or RTI.

Actions #4

Updated by Richard PALO over 8 years ago

Hi Gary, this is found https://reviews.csiden.org/r/156/ and has been submitted to RTI.
I'll add you as reviewer.

Actions #5

Updated by Electric Monk over 8 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

git commit e492095e1158c1621976ed8c4f7926d5ab5a8ea9

commit  e492095e1158c1621976ed8c4f7926d5ab5a8ea9
Author: Richard PALO <richard@NetBSD.org>
Date:   2015-03-09T17:52:14.000Z

    5588 invalid use of NULL in itm_util.c
    Reviewed by: Josef "Jeff" Sipek <jeffpc@josefsipek.net>
    Reviewed by: Gary Mills <gary_mills@fastmail.fm>
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Actions

Also available in: Atom PDF