Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for several error spotted by static analyzer #2242

Closed
wants to merge 3 commits into from

Conversation

ntfshard
Copy link

  • Check size before memory access -- we can access 1 extra element out of array
  • Use logical operator for bool type variables
  • Extra break removed

@ntfshard
Copy link
Author

ntfshard commented Jul 24, 2020

Also couple of places which is not clear, may be you could comment it:

  • bus/inputcontext.c:2845: The if condition is the same as the previous if condition:
    if (use_extension)
        context->preedit_visible = visible;
    if (use_extension)
        context->preedit_mode = mode;

src/ibusaccelgroup.c:385: len -= len;

fujiwarat pushed a commit that referenced this pull request Sep 3, 2020
- ibuscomposetable.c, ibusxml.c:
Check size before memory access

- inputcontext.c:
Use logical operator for bool type variables

- config.c:
Extra break removed

BUG=#2242
@fujiwarat fujiwarat added this to the 1.5.23 milestone Sep 3, 2020
@fujiwarat
Copy link
Member

Thank you for the patch.
Regarding to "src/ibusaccelgroup.c:385: len -= len;", I copied gtk_accelerator_parse_with_keycode() to ibus so please report the issue to gtk at first:
https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gtk/gtkaccelgroup.c#L475

@fujiwarat fujiwarat closed this Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants