Bug 90855 - Dangling pointer Issue in _cairo_surface_snapshot_acquire_source_image API.
Summary: Dangling pointer Issue in _cairo_surface_snapshot_acquire_source_image API.
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-05 03:14 UTC by Amarnath
Modified: 2015-06-05 06:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
This is patch file attached to fix the issue. (297 bytes, text/plain)
2015-06-05 03:14 UTC, Amarnath
Details

Description Amarnath 2015-06-05 03:14:56 UTC
Created attachment 116296 [details]
This is patch file attached to fix the issue.

After freeing any pointer which is pointing to dynamically allocated memory, Null should be assigned to pointer immediately after freeing to avoid dangling pointer situation.
In the code after freeing the memory under some condition null was not assigned to the pointer and outside the condition block it was getting assigned to another pointer.
Comment 1 Chris Wilson 2015-06-05 06:59:32 UTC
Accessing the pointer after the function returns an error is a much more severe error.

Better style is not to touch out parameters along error paths.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.