Project

General

Profile

Bug #11288

bootadm: NULL pointer errors

Added by Toomas Soome 3 months ago. Updated 3 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    bootadm_hyper.c: In function 'append_str':
    bootadm_hyper.c:75:31: error: comparison between pointer and integer [-Werror]
      if ((orig == NULL) || (*orig == NULL)) {
                                   ^~
    bootadm_hyper.c: In function 'get_token':
    bootadm_hyper.c:150:29: error: comparison between pointer and integer [-Werror]
      if ((str == NULL) || (*str == NULL))
                                 ^~
    bootadm_hyper.c:157:17: error: comparison between pointer and integer [-Werror]
        while ((*str != NULL) && (*str != quote))
                     ^~
    bootadm_hyper.c:161:15: error: comparison between pointer and integer [-Werror]
        if (*str++ == NULL)
                   ^~
    bootadm_hyper.c:166:26: error: comparison between pointer and integer [-Werror]
       for (dp = delim; ((*dp != NULL) && (*dp != *str)); dp++)
                              ^~
    bootadm_hyper.c:169:11: error: comparison between pointer and integer [-Werror]
       if (*dp != NULL) {
               ^~
    bootadm_hyper.c:186:18: error: comparison between pointer and integer [-Werror]
      } while (*str++ != NULL);
                      ^~
    bootadm_hyper.c: In function 'cvt_metal_option':
    bootadm_hyper.c:341:15: error: comparison between pointer and integer [-Werror]
      if (*++value == NULL)
                   ^~
    bootadm_hyper.c: In function 'cvt_hyper_option':
    bootadm_hyper.c:398:15: error: comparison between pointer and integer [-Werror]
      if (*++value == NULL)
                   ^~
    bootadm_hyper.c: In function 'parse_bootenvrc':
    bootadm_hyper.c:684:35: error: comparison between pointer and integer [-Werror]
       if (strncmp(line, "setprop", 7) != NULL)
                                       ^~
    bootadm_hyper.c: In function 'cvt_to_hyper':
    bootadm_hyper.c:916:43: error: comparison between pointer and integer [-Werror]
      if ((extra_args != NULL) && (*extra_args != NULL)) {
                                               ^~
    bootadm_hyper.c:928:19: error: comparison between pointer and integer [-Werror]
       if (*kern_bargs != NULL)
                       ^~
    bootadm_hyper.c:1006:17: error: comparison between pointer and integer [-Werror]
           ((*osroot == NULL) ? "/" : osroot));
                     ^~

    bootadm.c: In function 'list_setting':
    bootadm.c:1032:13: error: comparison between pointer and integer [-Werror]
      if (*which != NULL) {
                 ^~
    bootadm.c:1038:13: error: comparison between pointer and integer [-Werror]
       while (*p != NULL)
                 ^~
    bootadm.c:1059:20: error: comparison between pointer and integer [-Werror]
      found = (*setting == NULL);
                        ^~
    bootadm.c:1062:17: error: comparison between pointer and integer [-Werror]
       if ((*setting == NULL) && (lp->flags != BAM_COMMENT))
                     ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

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

git commit 23b5da0c3a749777311c1644e6ed463cc072104c

commit  23b5da0c3a749777311c1644e6ed463cc072104c
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-05T18:11:06.000Z

    11288 bootadm: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF