Resolves: #1963071 Fix minor covscan reviews

This commit is contained in:
Takao Fujiwara 2021-05-26 18:50:17 +09:00
parent 1d27fb286d
commit 445495ee06
2 changed files with 19 additions and 14 deletions

View File

@ -230,9 +230,9 @@ index e153081d..61194816 100644
-- --
2.28.0 2.28.0
From 65f709bb3a094a031ad7a7a802a12bd9ab7c27e2 Mon Sep 17 00:00:00 2001 From c3c224770a9db120713f86ce836cacbfcb178484 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com> From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Sun, 23 May 2021 23:09:26 +0900 Date: Wed, 26 May 2021 17:46:42 +0900
Subject: [PATCH] Fix code reviews Subject: [PATCH] Fix code reviews
--- ---
@ -262,10 +262,10 @@ Subject: [PATCH] Fix code reviews
util/IMdkit/i18nIc.c | 41 ++++++++-- util/IMdkit/i18nIc.c | 41 ++++++++--
util/IMdkit/i18nMethod.c | 24 +++++- util/IMdkit/i18nMethod.c | 24 +++++-
util/IMdkit/i18nOffsetCache.c | 2 +- util/IMdkit/i18nOffsetCache.c | 2 +-
util/IMdkit/i18nPtHdr.c | 147 ++++++++++++++++++++++++++++------ util/IMdkit/i18nPtHdr.c | 148 ++++++++++++++++++++++++++++------
util/IMdkit/i18nUtil.c | 20 +++++ util/IMdkit/i18nUtil.c | 20 +++++
util/IMdkit/i18nX.c | 29 ++++--- util/IMdkit/i18nX.c | 29 ++++---
29 files changed, 523 insertions(+), 172 deletions(-) 29 files changed, 524 insertions(+), 172 deletions(-)
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index e432e849..49a138fe 100644 index e432e849..49a138fe 100644
@ -1627,7 +1627,7 @@ index d5379051..e2fe8c6b 100644
data[i].offset = offset; data[i].offset = offset;
} }
diff --git a/util/IMdkit/i18nPtHdr.c b/util/IMdkit/i18nPtHdr.c diff --git a/util/IMdkit/i18nPtHdr.c b/util/IMdkit/i18nPtHdr.c
index eaeeee1c..367cc1e7 100644 index eaeeee1c..8dc52714 100644
--- a/util/IMdkit/i18nPtHdr.c --- a/util/IMdkit/i18nPtHdr.c
+++ b/util/IMdkit/i18nPtHdr.c +++ b/util/IMdkit/i18nPtHdr.c
@@ -181,8 +181,13 @@ static void OpenMessageProc(XIMS ims, IMProtocol *call_data, unsigned char *p) @@ -181,8 +181,13 @@ static void OpenMessageProc(XIMS ims, IMProtocol *call_data, unsigned char *p)
@ -1816,7 +1816,7 @@ index eaeeee1c..367cc1e7 100644
+ if (!im_attribute_list) { + if (!im_attribute_list) {
+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n", + fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
+ __FILE__, __LINE__); + __FILE__, __LINE__);
+ goto GetIMValuesMessageProc_finit; + goto GetIMValuesMessageProc_finit2;
+ } + }
/*endif*/ /*endif*/
@ -1834,7 +1834,7 @@ index eaeeee1c..367cc1e7 100644
} }
/*endif*/ /*endif*/
memset (reply, 0, total_size); memset (reply, 0, total_size);
@@ -840,12 +895,17 @@ static void GetIMValuesMessageProc (XIMS ims, @@ -840,12 +895,18 @@ static void GetIMValuesMessageProc (XIMS ims,
0, 0,
reply, reply,
total_size); total_size);
@ -1845,6 +1845,8 @@ index eaeeee1c..367cc1e7 100644
- XFree(im_attribute_list[i].value); - XFree(im_attribute_list[i].value);
- XFree (im_attribute_list); - XFree (im_attribute_list);
+GetIMValuesMessageProc_finit: +GetIMValuesMessageProc_finit:
+ FrameMgrFree (fm);
+GetIMValuesMessageProc_finit2:
+ if (im_attrID_list) + if (im_attrID_list)
+ XFree (im_attrID_list); + XFree (im_attrID_list);
+ if (im_attribute_list) { + if (im_attribute_list) {
@ -1852,11 +1854,10 @@ index eaeeee1c..367cc1e7 100644
+ XFree(im_attribute_list[i].value); + XFree(im_attribute_list[i].value);
+ XFree (im_attribute_list); + XFree (im_attribute_list);
+ } + }
+ FrameMgrFree (fm);
} }
static void CreateICMessageProc (XIMS ims, static void CreateICMessageProc (XIMS ims,
@@ -1435,6 +1495,11 @@ static void EncodingNegotiatonMessageProc (XIMS ims, @@ -1435,6 +1496,11 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
if (byte_length > 0) if (byte_length > 0)
{ {
enc_nego->encoding = (XIMStr *) malloc (sizeof (XIMStr)*10); enc_nego->encoding = (XIMStr *) malloc (sizeof (XIMStr)*10);
@ -1868,7 +1869,7 @@ index eaeeee1c..367cc1e7 100644
memset (enc_nego->encoding, 0, sizeof (XIMStr)*10); memset (enc_nego->encoding, 0, sizeof (XIMStr)*10);
i = 0; i = 0;
while (FrameMgrIsIterLoopEnd (fm, &status) == False) while (FrameMgrIsIterLoopEnd (fm, &status) == False)
@@ -1446,9 +1511,21 @@ static void EncodingNegotiatonMessageProc (XIMS ims, @@ -1446,9 +1512,21 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
FrameMgrSetSize (fm, str_length); FrameMgrSetSize (fm, str_length);
enc_nego->encoding[i].length = str_length; enc_nego->encoding[i].length = str_length;
FrameMgrGetToken (fm, name); FrameMgrGetToken (fm, name);
@ -1890,7 +1891,7 @@ index eaeeee1c..367cc1e7 100644
i++; i++;
} }
/*endwhile*/ /*endwhile*/
@@ -1460,20 +1537,37 @@ static void EncodingNegotiatonMessageProc (XIMS ims, @@ -1460,20 +1538,37 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
if (byte_length > 0) if (byte_length > 0)
{ {
enc_nego->encodinginfo = (XIMStr *) malloc (sizeof (XIMStr)*10); enc_nego->encodinginfo = (XIMStr *) malloc (sizeof (XIMStr)*10);
@ -1929,7 +1930,7 @@ index eaeeee1c..367cc1e7 100644
i++; i++;
} }
/*endwhile*/ /*endwhile*/
@@ -1524,6 +1618,7 @@ static void EncodingNegotiatonMessageProc (XIMS ims, @@ -1524,6 +1619,7 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
total_size); total_size);
XFree (reply); XFree (reply);

View File

@ -38,7 +38,7 @@
Name: ibus Name: ibus
Version: 1.5.24 Version: 1.5.24
Release: 5%{?dist} Release: 6%{?dist}
Summary: Intelligent Input Bus for Linux OS Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/ibus/%name/wiki URL: https://github.com/ibus/%name/wiki
@ -494,8 +494,12 @@ dconf update || :
%{_datadir}/installed-tests/ibus %{_datadir}/installed-tests/ibus
%changelog %changelog
* Wed May 26 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.24-6
- Fix minor covscan reviews. Related: rhbz#1963071
* Fri May 21 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.24-5 * Fri May 21 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.24-5
- Fix covscan reviews - Fix covscan reviews. Related: rhbz#1963071
- Implement ibus_im_context_set_surrounding_with_selection() - Implement ibus_im_context_set_surrounding_with_selection()
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.24-4 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.5.24-4