1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
From 5dc12cc56c79d293cf68d12a0b84373a785745e7 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 28 May 2019 16:27:31 -0400
Subject: [PATCH] Always initialize any variable we use with sscanf's %n
Signed-off-by: Peter Jones <pjones@redhat.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1892792
Origin: upstream,https://github.com/rhboot/efivar/commit/5dc12cc56c79d293cf68d12a0b84373a785745e7
Last-Updated: 2020-08-24
Index: efivar/src/linux-acpi-root.c
===================================================================
--- efivar.orig/src/linux-acpi-root.c
+++ efivar/src/linux-acpi-root.c
@@ -44,7 +44,7 @@ static ssize_t
parse_acpi_root(struct device *dev, const char *current, const char *root UNUSED)
{
int rc;
- int pos;
+ int pos = 0;
uint16_t pad0;
uint8_t pad1;
char *acpi_header = NULL;
Index: efivar/src/linux-pci-root.c
===================================================================
--- efivar.orig/src/linux-pci-root.c
+++ efivar/src/linux-pci-root.c
@@ -44,7 +44,7 @@ static ssize_t
parse_pci_root(struct device *dev, const char *current, const char *root UNUSED)
{
int rc;
- int pos;
+ int pos = 0;
uint16_t root_domain;
uint8_t root_bus;
const char *devpart = current;
Index: efivar/src/linux-pci.c
===================================================================
--- efivar.orig/src/linux-pci.c
+++ efivar/src/linux-pci.c
@@ -46,7 +46,7 @@ static ssize_t
parse_pci(struct device *dev, const char *current, const char *root)
{
int rc;
- int pos;
+ int pos = 0;
const char *devpart = current;
debug("entry");
Index: efivar/src/linux-soc-root.c
===================================================================
--- efivar.orig/src/linux-soc-root.c
+++ efivar/src/linux-soc-root.c
@@ -41,7 +41,7 @@ static ssize_t
parse_soc_root(struct device *dev UNUSED, const char *current, const char *root UNUSED)
{
int rc;
- int pos;
+ int pos = 0;
const char *devpart = current;
debug("entry");
Index: efivar/src/linux-virtblk.c
===================================================================
--- efivar.orig/src/linux-virtblk.c
+++ efivar/src/linux-virtblk.c
@@ -48,7 +48,7 @@ static ssize_t
parse_virtblk(struct device *dev, const char *current, const char *root UNUSED)
{
uint32_t tosser;
- int pos;
+ int pos = 0;
int rc;
debug("entry");
|