[Kaffe] could this buffer overflow?
max at immsp.kiev.ua
Fri Feb 5 18:03:46 PST 1999
I think, the better solution whould be usage of
char *buf =
The only problem is that there were talks here
that there are some problems with alloca?
Doesn't it exists for all compilers? Or there
may exists some problems with threads?
Maybe, code like
char *buf = alloca(...);
#define ALLOCATE_BUF(SIZE) char *buf = alloca(SIZE);
for most of platforms, and
#define ALLOCATE_BUF(SIZE) char buf;
for those that lacks of alloca,
will help to avoid the uncheched buffer problems
for most of compilers/platforms ?
Moses DeJong wrote:
> I was looking at some code in stackTrace.c in the function
> printStackTrace() when I noticed this.
> char buf;
> sprintf(buf, "\tat %.80s.%.80s(%s:%d)",
> Is it just me or does it seem like this buffer could overflow if
> the CLASS_SOURCEFILE name is longer than 30 chars?
> Why not use snprintf so?
> snprintf(buff, 200, ...
> Mo DeJong
> dejong at cs.umn.edu
More information about the kaffe