help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

another bug in gnats 4


From: Dirk Bergstrom
Subject: another bug in gnats 4
Date: Fri, 1 Feb 2002 19:41:31 -0800

i have discovered a bug in the field validation code in gnats 4.  if you pass a 
null pointer (instead of a string) as the value for an integer field, gnats 
will segfault.  i have a patch that fixes the immediate problem, but it doesn't 
attempt to solve any larger issues, such as why the null pointer is getting 
passed.

the patch is available here:

http://otisbean.com/gnats/edit-patch.txt

more detail:

in gnats 4, if you add a field to a database, that field will be empty in all 
existing PRs.  when you edit one of those PRs using gnatsweb or edit-pr, gnats 
works with the whole PR, and manages to do the Right Thing (presumably by 
populating the field with an empty string internally).  however, when you use 
pr-edit with --replace or --append, gnats evidently handles things differently, 
because it passes a null pointer to validateFieldValue().  this works for most 
field types, but the validation for integer fields was broken, and didn't check 
for a null pointer before pawing thru the supposed string.

it's quite likely that there are bigger problems here than just the segfault in 
validateFieldValue().  why is a null pointer getting passed?  where did it come 
from?  should some routine be checking for empty fields?  what should they be 
internally represented as?  i have chosen to ignore these issues, since i'm up 
to my eyeballs in another project, and i just need to make gnats stop 
segfaulting...

--
Dirk Bergstrom                   address@hidden
Computer Geek                     v: 707.433.0564
Juniper Networks Inc.             f: 707.433.0769

"it *looks* like a nail; lemme grab my hammer..."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]