make-alpha
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible Incorrect Pointer Reference in variable.c


From: Jon Forrest
Subject: Possible Incorrect Pointer Reference in variable.c
Date: Mon, 27 Sep 2021 11:48:01 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.1.1

In the latest rev of variable.c starting at line #1637 I see:


-----

1637 struct variable *
1638 try_variable_definition (const floc *flocp, const char *line,
1639                          enum variable_origin origin, int target_var)
1640 {
1641   struct variable v;
1642   struct variable *vp;
1643
1644   if (flocp != 0)
1645     v.fileinfo = *flocp;
1646   else
1647     v.fileinfo.filenm = 0;

-----

How can line #1647 ever work? "v" is a newly
created local variable, which means "v.fileinfo"
hasn't been given a value yet, which means that
"v.fileinfo.filenm" could be anywhere.

Cordially,
Jon Forrest




reply via email to

[Prev in Thread] Current Thread [Next in Thread]