Opened 10 years ago

Closed 10 years ago

#288 closed defect (fixed)

"use after destroy" in sqlite3_datasrc (which breaks sunstudio)

Reported by: jinmei Owned by: UnAssigned
Priority: high Milestone: 06. 4th Incremental Release
Component: data source Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


Please review the attached patch.

Jeremy's "exception on NXDOMAIN" with the sunstudio build should be solved with this patch.

It's quite trivial, but I'm getting it reviewed just in case. I'll wait a day or so, and if no one can find time for it I'll merge it to trunk anyway.

Proposed ChangeLog entry:

  75.?	[bug]		jinmei
	Fixed a bug in the sqlite3 data source where temporary strings
	could be referenced after destruction.  It caused various lookup
	failures with SunStudio build. (Trac #TBD, rTBD)


Attachments (1)

sqlite3_datasrc.diff (2.2 KB) - added by jinmei 10 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 10 years ago by jinmei

  • Owner set to UnAssigned
  • Status changed from new to reviewing

Changed 10 years ago by jinmei

comment:2 Changed 10 years ago by jinmei

Alternatively we could use SQLITE_TRANSIENT for sqlite3_bind_text instead of defining temporary string objects. We discussed this on jabber:

I didn't choose it because it would be a slightly less efficient, but since this code path is already pretty heavy it might make more sense to force a copy.
I'm fine with either policy.
the copy approach would make the code simpler, too, since we wouldn't need to define a temporary variable.

I like your first instinct, let's avoid copies even though the database lookup is already slow

And no objection to that, so we'll keep the current patch.

It was approved on jabber.

comment:3 Changed 10 years ago by jinmei

committed. closing ticket.

comment:4 Changed 10 years ago by jinmei

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.