« Return to Thread: gnatsd crashes when trying to lock a nonexistent PR

gnatsd crashes when trying to lock a nonexistent PR

by Alex-43 :: Rate this Message:

| View in Thread

I'm using version 4.1.0

How to reproduce:

$ ./gnatsd
...
210 User access level set to 'edit'
gnatsd: user 'alex' connected to database default
lock 2 alex 1234

Cannot allocate 4294967294 bytes after allocating 6279808 bytes


I've tracked the problem to be in pr.c function get_pr_path;
please explain the "else" clause of the first "if" statement:
What is the purpose of calling getCategoryFromIndex if "pr" is null ?
I put "return NULL" as a hack inside that else, and resolved this problem
(I now get "No PR 2 listed in the index").
get_pr_path gets always called after get_pr_from_index. If a PR is not in
the index, why does it bother with calling getCategoryFromIndex ?
In fact getCategoryFromIndex is only called by get_pr_path, and only when
the PR is not in the index (pr == NULL). What is the purpose trying to
find the category of a prnum that is not in the index?

Thanks,
Alex


if (pr != NULL)
     {
       category = field_value (pr, CATEGORY (database));
     }
   else
     { ### WHY NOT RETURN NULL HERE ??? <<<<<<<<<<<<<<
       categoryFromIndex = getCategoryFromIndex (database, prnum, err);
       category = categoryFromIndex;
     }



_______________________________________________
Bug-gnats mailing list
Bug-gnats@...
http://lists.gnu.org/mailman/listinfo/bug-gnats

 « Return to Thread: gnatsd crashes when trying to lock a nonexistent PR