On Thu, Jun 27, 2013 at 1:43 AM, Marek Czerski <[email protected]> wrote:


> I found a bug in gnuradio-core/src/lib/general/gri_fft.cc, in function:
> static const char * wisdom_filename ()
>
> It returns pointer to char string from temporary object created by call
> to path.string(). Obviously, this pointer is pointing to garbage after exit
> from wisdom_filename() function.
>

The current usage is correct.  The object "path" is declared (in line 79)
with "static local" scope, which means that it persists in between calls to
the function. In line 80, it is assigned a value, and the return value from
the function is a const pointer to the internal storage of the object.

A reasonable explanation of "static local" scope is here:

https://en.wikipedia.org/wiki/Local_variable#Static_local_variables

-- 
Johnathan Corgan
Corgan Labs - SDR Training and Development Services
http://corganlabs.com
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to