Project

General

Profile

Actions

Bug #4307

closed

Variable is used before it is initialized in kwarndtest.c

Added by Ilya Usvyatsky over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Category:
cmd - userland programs
Start date:
2013-11-08
Due date:
% Done:

100%

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

Description

gcc -Wuinitialized complains about
https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/krb5/kwarn/kwarndtest.c#L99

Quick analysis reveals that indeed argv_array is passed into FREE uninitialized.
The correct variable to pass into FREE is argv, so the whole string should look like

FREE(argv, (argc+1)*sizeof (char *));

Related issues

Has duplicate illumos gate - Bug #4119: Mistake in kwarndtest breaks the buildClosed2013-09-08

Actions
Actions #1

Updated by Ilya Usvyatsky over 9 years ago

  • Category set to tests
  • Assignee set to Ilya Usvyatsky
  • Difficulty changed from Medium to Bite-size
Actions #2

Updated by Yuri Pankov over 9 years ago

  • Category changed from tests to cmd - userland programs
  • Tags deleted (needs-triage)
Actions #3

Updated by Ilya Usvyatsky over 9 years ago

Webrev is created for the fix: http://cr.illumos.org/~webrev/usvyatsky/4307/

Actions #4

Updated by Yuri Pankov over 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Resolved in:

commit 7140fde549ff65142379ea6e25e6276552e22f3f
Author: Ilya Usvyatsky <ilya.usvyatsky@nexenta.com>
Date:   Sun Nov 10 18:19:34 2013 -0500

    4307 Variable is used before it is initialized in kwarndtest.c
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Marcel Telka <marcel@telka.sk>
    Approved by: Dan McDonald <danmcd@nexenta.com>

Actions #5

Updated by Andrew Stormont over 9 years ago

This is a duplicate of #4119. Next time please search before creating a new issue.

Actions

Also available in: Atom PDF