* updated maddy (0.7.1 -> 0.8.1), untested
[t2sde.git] / package / x86 / msr-tools / hotfix-a-segfault.patch
blobc784a95e881417551053a17ea850d600a1cb5efa
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/msr-tools/hotfix-a-segfault.patch
3 # Copyright (C) 2023 The T2 SDE Project
4 #
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7 #
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 --- msr-tools-master/rdmsr.c.vanilla 2023-08-26 17:02:52.420666222 +0200
15 +++ msr-tools-master/rdmsr.c 2023-08-26 17:09:37.163645760 +0200
16 @@ -109,6 +109,10 @@
17 int dir_entries;
19 dir_entries = scandir("/dev/cpu", &namelist, dir_filter, 0);
20 + if (dir_entries < 0) {
21 + perror("rdmsr: scandir");
22 + exit(1);
23 + }
24 while (dir_entries--) {
25 rdmsr_on_cpu(reg, atoi(namelist[dir_entries]->d_name));
26 free(namelist[dir_entries]);
27 --- msr-tools-master/wrmsr.c.vanilla 2023-08-26 17:09:46.107645307 +0200
28 +++ msr-tools-master/wrmsr.c 2023-08-26 17:11:22.614640428 +0200
29 @@ -70,6 +70,10 @@
30 int dir_entries;
32 dir_entries = scandir("/dev/cpu", &namelist, dir_filter, 0);
33 + if (dir_entries < 0) {
34 + perror("wrmsr: scandir");
35 + exit(1);
36 + }
37 while (dir_entries--) {
38 wrmsr_on_cpu(reg, atoi(namelist[dir_entries]->d_name),
39 valcnt, regvals);