[MXS-30] bugzillaId-487: Buffer manager should not use pointer arithmetic on void* Created: 2014-01-27  Updated: 2015-06-17  Resolved: 2015-05-05

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 1.0.0
Fix Version/s: 1.1.1

Type: Bug Priority: Minor
Reporter: martin brampton (Inactive) Assignee: martin brampton (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux



 Description   

This is imported from bugzilla item: http://bugs.mariadb.com/show_bug.cgi?id=487

martin.brampton@skysql.com 2014-08-27 09:46:21 UTC
In the gwbuf_alloc function, the pointer to the end of the data is computed from the void *start. This is illegal according to the C standard: http://stackoverflow.com/questions/3523145/pointer-arithmetic-for-void-pointer-in-c. Correct use is shown in the gwbuf_clone_portion function.



 Comments   
Comment by Dipti Joshi (Inactive) [ 2015-03-09 ]

This is comment history imported from bugzilla

Comment 1 martin.brampton@skysql.com 2014-08-27 11:06:30 UTC
Same applies to the macros that adjust the pointers to the data buffer.

Comment by martin brampton (Inactive) [ 2015-05-05 ]

As stated

Comment by martin brampton (Inactive) [ 2015-05-05 ]

Fixed

Comment by Timofey Turenko [ 2015-05-12 ]

verified by checking changes of source code

Generated at Thu Feb 08 03:56:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.