Backport fix for uninitialized variable
This commit is contained in:
parent
f265390897
commit
1cc2a7dd30
47
0001-src-initialize-keymaps-variable.patch
Normal file
47
0001-src-initialize-keymaps-variable.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 9e36a59c806de3de77c046df0b8c80bd9a0f4863 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
||||
Date: Fri, 23 Apr 2021 15:58:56 +0200
|
||||
Subject: [PATCH] src: initialize keymaps variable
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
My clang version 11.0.0 (Fedora 11.0.0-2.fc33) complains:
|
||||
../src/virt-viewer-app.c:610:9: error: variable 'keymaps' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
|
||||
if (keymap_string) {
|
||||
^~~~~~~~~~~~~
|
||||
../src/virt-viewer-app.c:614:10: note: uninitialized use occurs here
|
||||
if (!keymaps || g_strv_length(keymaps) == 0) {
|
||||
^~~~~~~
|
||||
../src/virt-viewer-app.c:610:5: note: remove the 'if' if its condition is always true
|
||||
if (keymap_string) {
|
||||
^~~~~~~~~~~~~~~~~~~
|
||||
../src/virt-viewer-app.c:595:27: note: initialize the variable 'keymaps' to silence this warning
|
||||
gchar **key, **keymaps, **valkey, **valuekeys = NULL;
|
||||
^
|
||||
= NULL
|
||||
1 error generated.
|
||||
|
||||
Initialize the variable to fix the uninitialized use.
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
src/virt-viewer-app.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
|
||||
index 0095398..de2677c 100644
|
||||
--- a/src/virt-viewer-app.c
|
||||
+++ b/src/virt-viewer-app.c
|
||||
@@ -592,7 +592,7 @@ static
|
||||
void virt_viewer_app_set_keymap(VirtViewerApp *self, const gchar *keymap_string)
|
||||
{
|
||||
VirtViewerAppPrivate *priv = virt_viewer_app_get_instance_private(self);
|
||||
- gchar **key, **keymaps, **valkey, **valuekeys = NULL;
|
||||
+ gchar **key, **keymaps = NULL, **valkey, **valuekeys = NULL;
|
||||
VirtViewerKeyMapping *keyMappingArray, *keyMappingPtr;
|
||||
guint *mappedArray, *ptrMove;
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -10,12 +10,13 @@
|
||||
|
||||
Name: virt-viewer
|
||||
Version: 10.0
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
Summary: Virtual Machine Viewer
|
||||
License: GPLv2+
|
||||
URL: https://gitlab.com/virt-viewer/virt-viewer
|
||||
Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.xz
|
||||
Patch1: 0001-src-avoid-warnings-from-use-of-G_GNUC_FALLTHROUGH.patch
|
||||
Patch2: 0001-src-initialize-keymaps-variable.patch
|
||||
Requires: openssh-clients
|
||||
|
||||
BuildRequires: gcc
|
||||
@ -78,6 +79,9 @@ the display, and libvirt for looking up VNC/SPICE server details.
|
||||
%{_datadir}/bash-completion/completions/virt-viewer
|
||||
|
||||
%changelog
|
||||
* Tue Nov 16 2021 Tom Stellard <tstellar@redhat.com> - 10.0-5
|
||||
- Backport fix for uninitialized variable
|
||||
|
||||
* Wed Aug 11 2021 Daniel P. Berrangé <berrange@redhat.com> - 10.0-4
|
||||
- Fix build with newer glib (rhbz#1988037)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user