26 lines
857 B
Diff
26 lines
857 B
Diff
|
|
From 05f7ea8fa198a6b98dd98cb1a8b1774da701e917 Mon Sep 17 00:00:00 2001
|
||
|
|
From: xujing <xujing125@huawei.com>
|
||
|
|
Date: Fri, 12 Aug 2022 10:01:32 +0800
|
||
|
|
Subject: [PATCH] fix coredump while parseServiceInfo return 1
|
||
|
|
|
||
|
|
---
|
||
|
|
leveldb.c | 2 +-
|
||
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/leveldb.c b/leveldb.c
|
||
|
|
index 7b8c1bd..8a7a81d 100644
|
||
|
|
--- a/leveldb.c
|
||
|
|
+++ b/leveldb.c
|
||
|
|
@@ -377,7 +377,7 @@ int readServiceInfo(char *name, int type, struct service *service,
|
||
|
|
asprintf(&filename, RUNLEVELS "/chkconfig.d/%s", name);
|
||
|
|
if ((fd = open(filename, O_RDONLY)) >= 0) {
|
||
|
|
parseret = parseServiceInfo(fd, name, &serv_overrides, honorHide, 1);
|
||
|
|
- if (parseret >= 0) {
|
||
|
|
+ if (parseret == 0) {
|
||
|
|
if (serv_overrides.name)
|
||
|
|
serv.name = serv_overrides.name;
|
||
|
|
if (serv_overrides.levels != -1)
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|