[ovs-dev] [PATCH] classifier: Fix use of uninitialized value.

William Tu u9012063 at gmail.com
Tue Mar 17 21:39:40 UTC 2020


Coverity reports use of uninitialized value of cursor.
This happens in cls_cursor_start(), when rule is false,
cursor.subtable is uninitialized. CID 279324.

Signed-off-by: William Tu <u9012063 at gmail.com>
---
 lib/classifier.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/classifier.c b/lib/classifier.c
index 0fad953213e4..a22f9fb957ea 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -1370,6 +1370,7 @@ cls_cursor_start(const struct classifier *cls, const struct cls_rule *target,
     struct cls_cursor cursor;
     struct cls_subtable *subtable;
 
+    memset(&cursor, 0x0, sizeof cursor);
     cursor.cls = cls;
     cursor.target = target && !cls_rule_is_catchall(target) ? target : NULL;
     cursor.version = version;
-- 
2.7.4



More information about the dev mailing list