|
From: | Shigio YAMAGUCHI |
Subject: | Re: [BUG] One bug, one possible bug and some small speed improvements |
Date: | Mon, 16 Mar 2015 11:26:32 +0900 |
Hi.
One bug, one possible bug and some small speed improvements.
(in GNU Global 6.3.4 source).
The bug is in getconfs() [conf.c] parameter sb is not tested in all the places
it is used, against NULL.
I added the following temporary test code after 'if (!exist) {', line 392:
if(sb == NULL)
die("sb == NULL in getconfs()");
and it kept dying [die()ing] and displaying that message.
The possible bug is in setupdbpath() [getdbpath.c], the return value from the call
to 's = strbuf_fgets(sb, fp, STRBUF_NOCRLF);' on line 306 could be NULL, and the next
function called is 'if (!test("d", s)) {', test() would use the previous pathname used,
which would be the wrong one or it would die(); if the file was empty, but not sure
if this is possible.
The speed improvements are:
1. Removal of duplicate uses of strlen() in assoc.c and dbop.c
2. A change to use strbuf_getlen() instead of strlen() in makepath() [makepath.c]
3. A moved strlen() in getconfs() [conf.c] as the string it uses doesn't change
in the loop.
I have also added some additions to the Doxygen comments.
Simon Dommett
_______________________________________________
Bug-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-global
[Prev in Thread] | Current Thread | [Next in Thread] |