ALT Linux Bugzilla
– Attachment 8839 Details for
Bug 38616
/usr/sbin/hddtemp -nq -u C /dev/sda Ошибка сегментирования
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
патч vt@ из сборочного задания 253512
0001-Prevent-crash-on-numeric-unit-conversion-when-disk-i.patch (text/plain), 1.10 KB, created by
Michael Shigorin
on 2020-06-16 13:37:29 MSK
(
hide
)
Description:
патч vt@ из сборочного задания 253512
Filename:
MIME Type:
Creator:
Michael Shigorin
Created:
2020-06-16 13:37:29 MSK
Size:
1.10 KB
patch
obsolete
>From 39041c23a9390f196b03f9b7173b6395f4459480 Mon Sep 17 00:00:00 2001 >From: Vitaly Chikunov <vt@altlinux.org> >Date: Tue, 16 Jun 2020 13:07:18 +0300 >Subject: [PATCH] Prevent crash on numeric unit conversion when disk is not in > db > >Default unit is assumed C. > >Segmentation fault is happened in `inxi` run of `/usr/sbin/hddtemp -nq >-u C /dev/sda` on ST3500514NS. >--- > hddtemp/src/hddtemp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git hddtemp/src/hddtemp.c hddtemp/src/hddtemp.c >index 7e54927..2213c7d 100644 >--- hddtemp/src/hddtemp.c >+++ hddtemp/src/hddtemp.c >@@ -92,13 +92,17 @@ static void init_bus_types() { > *******************************************************/ > > int value_to_unit(struct disk *dsk) { >+ unsigned char dsk_unit = 'C'; >+ >+ if (dsk->db_entry) >+ dsk_unit = dsk->db_entry->unit; > switch(unit) { > case CELSIUS: >- if(dsk->db_entry->unit == 'F') >+ if(dsk_unit == 'F') > return F_to_C(dsk->value); > break; > case FAHRENHEIT: >- if(dsk->db_entry->unit == 'C') >+ if(dsk_unit == 'C') > return C_to_F(dsk->value); > default: > break; >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38616
: 8839