1772698 - dont use uninitialized value as an index
This commit is contained in:
parent
80149bea94
commit
61d7a0bd9d
@ -26,7 +26,7 @@ index 20df27a..7ed4918 100644
|
|||||||
{
|
{
|
||||||
stat = HPMUD_R_INVALID_URI; /* different device plugged in */
|
stat = HPMUD_R_INVALID_URI; /* different device plugged in */
|
||||||
diff --git a/io/hpmud/model.c b/io/hpmud/model.c
|
diff --git a/io/hpmud/model.c b/io/hpmud/model.c
|
||||||
index d546ec1..d1809a9 100644
|
index d546ec1..adb3d87 100644
|
||||||
--- a/io/hpmud/model.c
|
--- a/io/hpmud/model.c
|
||||||
+++ b/io/hpmud/model.c
|
+++ b/io/hpmud/model.c
|
||||||
@@ -407,7 +407,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
|
@@ -407,7 +407,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
|
||||||
@ -41,13 +41,11 @@ index d546ec1..d1809a9 100644
|
|||||||
|
|
||||||
if ((fp = fopen(datFile, "r")) == NULL)
|
if ((fp = fopen(datFile, "r")) == NULL)
|
||||||
goto bugout;
|
goto bugout;
|
||||||
@@ -420,12 +423,18 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
|
@@ -422,10 +425,17 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int *
|
||||||
if (rcbuf[0] == '[')
|
|
||||||
{
|
|
||||||
strncpy(section, rcbuf+1, sizeof(section)); /* found new section */
|
strncpy(section, rcbuf+1, sizeof(section)); /* found new section */
|
||||||
- n = strlen(section);
|
n = strlen(section);
|
||||||
section[n-2]=0; /* remove ']' and CR */
|
section[n-2]=0; /* remove ']' and CR */
|
||||||
+ n = strlen(section);
|
+ n -= 2;
|
||||||
if (strcasecmp(model, section) == 0 ||
|
if (strcasecmp(model, section) == 0 ||
|
||||||
- (section[0] == 'h' && section[1] == 'p' &&
|
- (section[0] == 'h' && section[1] == 'p' &&
|
||||||
- section[2] == '_' &&
|
- section[2] == '_' &&
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 3.20.6
|
Version: 3.20.6
|
||||||
Release: 8%{?dist}
|
Release: 9%{?dist}
|
||||||
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
|
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
|
||||||
|
|
||||||
Url: https://developers.hp.com/hp-linux-imaging-and-printing
|
Url: https://developers.hp.com/hp-linux-imaging-and-printing
|
||||||
@ -738,6 +738,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
|
|||||||
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
|
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 25 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.6-9
|
||||||
|
- 1772698 - dont use uninitialized value as an index
|
||||||
|
|
||||||
* Mon Aug 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.6-8
|
* Mon Aug 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.6-8
|
||||||
- typo in hplip-model-mismatch.patch causes regression for 1772698
|
- typo in hplip-model-mismatch.patch causes regression for 1772698
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user