Ticket #801 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

[PATCH] pointer checks

Reported by: microe Owned by: dgollub
Priority: normal Milestone: 0.40
Component: Engine Version: 0.36
Severity: minor Keywords:
Cc:

Description

1. At line 210 of opensync_merger.c new_node is checked for null. Then

at line 213 new_node is dereferenced to get the doc pointer for the destination doc.

Remove call (and commented out call).

2. In opensync_xml.c at line 219 the two pointers are compared. But at

line 223 they are checked for null. Since strcmp will dereference both pointers to compare their strings this would cause a segfault.

Move the pointer test to before the strcmp.

3. In opensync_serializer.c auth is checked when *auth was the pointer

that was actually given the allocated authentication object.

Change the check to *auth.

Attachments

opensync-pointer-checks.patch (2.7 KB) - added by microe 4 months ago.
Fixes three pointer check defects in opensync (in trunk)
opensync-pointer-checks (8.3 KB) - added by microe 4 months ago.
Expanded patch. Same theme - fixes defective pointer checks (or adds them)

Change History

Changed 4 months ago by microe

Fixes three pointer check defects in opensync (in trunk)

  Changed 4 months ago by felixmoeller

  • summary changed from pointer checks to [PATCH] pointer checks

Changed 4 months ago by microe

Expanded patch. Same theme - fixes defective pointer checks (or adds them)

  Changed 4 months ago by dgollub

  • status changed from new to assigned

Very impressive catches! Just curious - how did you find all those nasty bugs?

Testsuite is running on the patched build...

  Changed 4 months ago by dgollub

  • status changed from assigned to closed
  • resolution set to fixed

Thanks a lot! Committed - r3537

follow-up: ↓ 5   Changed 4 months ago by microe

I didn't find them. Coverity prevent did. Thanks.

in reply to: ↑ 4   Changed 4 months ago by dgollub

Replying to microe:

I didn't find them. Coverity prevent did. Thanks.

I see - does Coverity report more issue? How did you got access to Coverity - i heard OSS projects can apply for an audit.

  Changed 4 months ago by microe

prevent does not report anything else. And the analysis was set to check everything.

You can apply. And now that opensync is pretty much clear of defects it can go up to a ring or two if it is selected.

Note: See TracTickets for help on using tickets.