Bug 705 - ub_ctx_set_fwd() return value mishandled
ub_ctx_set_fwd() return value mishandled
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.4
x86_64 OpenBSD
: P5 enhancement
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-05 08:20 CEST by Jonathan Gray
Modified: 2015-09-22 11:01 CEST (History)
2 users (show)

See Also:


Attachments
patch to correct the return value (590 bytes, patch)
2015-09-05 08:20 CEST, Jonathan Gray
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Gray 2015-09-05 08:20:55 CEST
Created attachment 296 [details]
patch to correct the return value

In ub_ctx_resolvconf() the code does "(retval = ub_ctx_set_fwd() != 0).  Due to != having higher precedence than = this means all non 0 return values will be treated as 1.
Comment 1 Wouter Wijngaards 2015-09-22 11:01:03 CEST
Hi Jonathan,

Thank you for the patch, I have applied it.

By the way that code is ifdef for windows, not OpenBSD, where it would use line 996.

Best regards, Wouter