Project

General

Profile

Bug #4307

Variable is used before it is initialized in kwarndtest.c

Added by Ilya Usvyatsky about 7 years ago. Updated about 7 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:

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
#1

Updated by Ilya Usvyatsky about 7 years ago

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

Updated by Yuri Pankov about 7 years ago

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

Updated by Ilya Usvyatsky about 7 years ago

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

#4

Updated by Yuri Pankov about 7 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>

#5

Updated by Andrew Stormont about 7 years ago

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

Also available in: Atom PDF