RyzenAdj: fix segfault on musl.

This commit is contained in:
Érico Nogueira 2021-03-24 16:35:59 -03:00 committed by Érico Nogueira Rolim
parent a7339d71d7
commit 5d5268b8fa
2 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,36 @@
From 6efee1997c468150f472941f0f183fc054b436a4 Mon Sep 17 00:00:00 2001
From: unknown <Falcosc@users.noreply.github.com>
Date: Sat, 27 Feb 2021 01:26:18 +0100
Subject: [PATCH] fix Heap corruption
---
lib/nb_smu_ops.c | 2 +-
lib/ryzenadj.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/nb_smu_ops.c b/lib/nb_smu_ops.c
index 965264c..2c31b48 100644
--- a/lib/nb_smu_ops.c
+++ b/lib/nb_smu_ops.c
@@ -45,7 +45,7 @@ smu_t get_smu(nb_t nb, int smu_type) {
uint32_t rep; /* REP of test message */
smu_service_args_t arg = {0, 0, 0, 0, 0, 0}; /* Test message shuld have no arguments */
- smu = (smu_t)malloc((sizeof(smu_t)));
+ smu = (smu_t)malloc((sizeof(*smu)));
smu->nb = nb;
/* Fill SMU information */
switch(smu_type){
diff --git a/lib/ryzenadj.h b/lib/ryzenadj.h
index 6f18ade..90c94ee 100644
--- a/lib/ryzenadj.h
+++ b/lib/ryzenadj.h
@@ -10,7 +10,7 @@ extern "C" {
#define RYZENADJ_REVISION_VER 0
#define RYZENADJ_MAJOR_VER 7
-#define RYZENADJ_MINIOR_VER 0
+#define RYZENADJ_MINIOR_VER 1
enum ryzen_family {
FAM_UNKNOWN = -1,

View file

@ -1,7 +1,7 @@
# Template file for 'RyzenAdj'
pkgname=RyzenAdj
version=0.7.0
revision=1
revision=2
archs="x86_64*"
build_style=cmake
makedepends="pciutils-devel"
@ -11,6 +11,7 @@ license="LGPL-3.0-only"
homepage="https://github.com/FlyGoat/RyzenAdj"
distfiles="https://github.com/FlyGoat/RyzenAdj/archive/v${version}.tar.gz"
checksum=fff8a08e657ba35f919bd564fbe2e15e7c615ac6e2a357ffcc3472069e8081f6
patch_args=-Np1
do_install() {
vbin build/ryzenadj