aboutsummaryrefslogtreecommitdiffstats
path: root/community/libyang/CVE-2021-28904.patch
blob: df87f28e7687bc22d866248fcf93065aa7964077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 59a0bff1a5a2f0a0eac07e4bf94d4aea9dd3708d Mon Sep 17 00:00:00 2001
From: Michal Vasko <mvasko@cesnet.cz>
Date: Mon, 8 Mar 2021 09:20:30 +0100
Subject: [PATCH] plugins BUGFIX handle empty revision correctly

Fixes #1451
---
 src/plugins.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/plugins.c b/src/plugins.c
index 7e6fdf358..fa62ce76c 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -457,9 +457,8 @@ ext_get_plugin(const char *name, const char *module, const char *revision)
     assert(module);
 
     for (u = 0; u < ext_plugins_count; u++) {
-        if (!strcmp(name, ext_plugins[u].name) &&
-                !strcmp(module, ext_plugins[u].module) &&
-                (!ext_plugins[u].revision || !strcmp(revision, ext_plugins[u].revision))) {
+        if (!strcmp(name, ext_plugins[u].name) && !strcmp(module, ext_plugins[u].module) &&
+                ((!revision && !ext_plugins[u].revision) || (revision && !strcmp(revision, ext_plugins[u].revision)))) {
             /* we have the match */
             return ext_plugins[u].plugin;
         }