[MDEV-29891] a suggestion of implementation of stop_word.c Created: 2022-10-27  Updated: 2022-10-27  Resolved: 2022-10-27

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Mroonga
Affects Version/s: 10.11.0
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: ash1852 Assignee: Kouhei Sutou
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

ubuntu20.04


Attachments: PNG File image-2022-10-27-10-51-52-161.png    
Issue Links:
Relates
relates to MDEV-20544 Update version of Mroonga storage engine Open

 Description   

Hi, I found a fragile code in implementation of stop_word.c that may occur null pointer dereference, and I have shown the execution sequence of the program that may generate the bug on the figure below. The red text illustrates the steps that generate the bug, the file path can be seen in the blue framed section.

if a guard is here to provide this case, just like line 97-line 99 in above figure, i think it good for robustness of project
Although the code shown is for version 10.3 but is still exist in current version

would you can help to check if this?thank you for your effort and patience!



 Comments   
Comment by Daniel Black [ 2022-10-27 ]

The mroonga upstream doesn't appear to have any of these references in their repository.

Our update seems to be waiting on MDEV-20544.

Do you have a SQL/data that can trigger this? I could just be overly cautious code in some areas that can't be reached.

Comment by ash1852 [ 2022-10-27 ]

Currently there is no data to trigger this, this code snippet is identified as fragile by our analysis tool, so I'm just making a suggestion as it doesn't seem like much work, just need add a guard, like code in line 98.

Comment by Kouhei Sutou [ 2022-10-27 ]

Thanks for the suggestion!
But current_token is never NULL. So this is safe.

Generated at Thu Feb 08 10:12:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.