public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* sourcenav 4.52 cparser.c fix for MANY function args
@ 2000-11-02  0:44 Ed P.
  2000-11-02  0:53 ` Mo DeJong
  0 siblings, 1 reply; 3+ messages in thread
From: Ed P. @ 2000-11-02  0:44 UTC (permalink / raw)
  To: edp, sourcenav; +Cc: gravenk

I fixed a bug in the source navigator cbrowser's cparser.c.

Regards,
Ed Pendzik
edp@eznet.net

--------------------------------------------------
Text description
--------------------------------------------------
snavigator/parsers/cpp/cparser.c: increased 2 fixed string buffers  
to prevent core dump when parsing functions with many (67+) arguments.
--------------------------------------------------
ChangeLog entry
--------------------------------------------------
2000-11-02  Ed Pendzik  <edp@eznet.net>

        * snavigator/parsers/cpp/cparser.c: increased 2 fixed string buffers  
          to prevent core dump when parsing functions with many (67+) 
          arguments.
          
--------------------------------------------------
diff -c3p SN452-source/snavigator/parsers/cpp/cparser.c.orig SN452-source/snavigator/parsers/cpp/cparser.c
--------------------------------------------------

*** SN452-source/snavigator/parsers/cpp/cparser.c.orig	Thu Nov  2 01:51:25 2000
--- SN452-source/snavigator/parsers/cpp/cparser.c	Thu Nov  2 01:52:45 2000
*************** extern void put_cross1( int type, char *
*** 6166,6172 ****
     if( cross_ref_fp )
     {
        Tcl_DString utfString;
!       char tmp[1000];
  
        sprintf(tmp,"%d;%d;%s;%d;%d;%d;%d;%ld;%s;%s;%s;%s;%s;%d;\n"
            , PAF_CROSS_REF_CPP
--- 6166,6172 ----
     if( cross_ref_fp )
     {
        Tcl_DString utfString;
!       char tmp[4096];
  
        sprintf(tmp,"%d;%d;%s;%d;%d;%d;%d;%ld;%s;%s;%s;%s;%s;%d;\n"
            , PAF_CROSS_REF_CPP
*************** extern int f_charno( int i )
*** 7053,7059 ****
  extern char *identstring( int i )
  {
     sString_t sString;
!    static char ac[1000];
  
     sString = ident( i );
  
--- 7053,7059 ----
  extern char *identstring( int i )
  {
     sString_t sString;
!    static char ac[4096];
  
     sString = ident( i );
  
--------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sourcenav 4.52 cparser.c fix for MANY function args
  2000-11-02  0:44 sourcenav 4.52 cparser.c fix for MANY function args Ed P.
@ 2000-11-02  0:53 ` Mo DeJong
  2000-11-02  2:27   ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Mo DeJong @ 2000-11-02  0:53 UTC (permalink / raw)
  To: sourcenav

On Thu, 2 Nov 2000, Ed P. wrote:

> I fixed a bug in the source navigator cbrowser's cparser.c.
> 
> Regards,
> Ed Pendzik
> edp@eznet.net

Funny, I just fixed that but the other day :)

Your fix makes the buffers bigger. That might make
the crashes go away but if you had a function with
a ton of arguments, it would come back.

My solution to this problem was to use snprintf()
and pass in the size of the buffer. What do you
think of that approach?

Mo DeJong
Red Hat Inc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sourcenav 4.52 cparser.c fix for MANY function args
  2000-11-02  0:53 ` Mo DeJong
@ 2000-11-02  2:27   ` Andrew Cagney
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2000-11-02  2:27 UTC (permalink / raw)
  To: Mo DeJong; +Cc: sourcenav

Mo DeJong wrote:
> 
> On Thu, 2 Nov 2000, Ed P. wrote:
> 
> > I fixed a bug in the source navigator cbrowser's cparser.c.
> >
> > Regards,
> > Ed Pendzik
> > edp@eznet.net
> 
> Funny, I just fixed that but the other day :)
> 
> Your fix makes the buffers bigger. That might make
> the crashes go away but if you had a function with
> a ton of arguments, it would come back.
> 
> My solution to this problem was to use snprintf()
> and pass in the size of the buffer. What do you
> think of that approach?

Check asprintf().
	Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-11-02  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-02  0:44 sourcenav 4.52 cparser.c fix for MANY function args Ed P.
2000-11-02  0:53 ` Mo DeJong
2000-11-02  2:27   ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).