Project

General

Profile

Bug #89

uu_list_find() leaves error unset when successfully returning NULL

Added by David Fotel almost 10 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2010-08-23
Due date:
% Done:

90%

Estimated time:
Difficulty:
Tags:
Gerrit CR:

Description

bustos 2004-12-13

See comments.

 2004-12-14 00:25:00 GMT
[dp: bug is marked bite-size but description was opaque. relocated comments]

bustos 2004-12-13

If uu_list_find() is called on a list which doesn't have a comparison
function, then it sets the uu_error() to UU_ERROR_NOT_SUPPORTED and
returns NULL. NULL is also the return value for when uu_list_find()
completes successfully, but didn't find anything. If the uu_error()
happened to be UU_ERROR_NOT_SUPPORTED before uu_list_find() was
called, then there's no way for the caller to know whether the function
completed successfully.

 2004-12-14 00:25:00 GMT

Files

test.c (1.74 KB) test.c Jason King, 2011-01-20 04:34 PM

History

#1

Updated by Gary Mills almost 10 years ago

This appears easy to fix, but finding a way to reproduce the
problem and to test the fix seems very difficult. In almost all
cases, the caller of uu_list_find() tests for a NULL return value
but does not proceed to test the uu_error() value. Nothing would
change if uu_list_find() set the error value correctly. Is there any
point at guessing at a fix?

#2

Updated by Jason King over 9 years ago

  • Category set to lib - userland libraries
  • Status changed from New to In Progress
  • Assignee set to Jason King

Webrev available at: http://cr.illumos.org/view/83aaaxjr/

There probably isn't a good way to force a test, but I think inspection + nightly should be sufficient.

#3

Updated by Jason King over 9 years ago

Managed to create a test case

#4

Updated by Jason King over 9 years ago

  • Status changed from In Progress to Resolved

Resolved with commit:1826d6245009

Also available in: Atom PDF