get_self_executable() returns address of local variable

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Lorsch
Posts: 3
Joined: Sun Jun 13, 2010 9:05 am

get_self_executable() returns address of local variable

#1 Post by Lorsch »

Hi,

Yesterday I downloaded t-engine4-src-1.0.0beta3 from http://tome.te4.org/download. In src/getself.c I found

Code: Select all

const char *get_self_executable(int argc, char **argv)
{
        char res[PATH_MAX];
        ...
        return res;
}
The storage class of res should probably be static.

Lorsch

Post Reply