Skip to contentSkip to conversation

eal: fix check for default plugin directory

PATCH Applied Bruce Richardson 3 participants 3 messages Nov 6, 2017 – Nov 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: fix check for default plugin directory

The check for the existence of the default plugin directory calls stat using an incorrect variable, which will cause a NULL pointer dereference error.

Coverity issue: 198440

Fixes d6a4399cdfc9 ("eal: avoid error for non-existent default PMD path")
---
 lib/librte_eal/common/eal_common_options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/eal_common_options.c +1 -1
index 450f2664a..996a03424 100644
@@ -280,7 +280,7 @@ eal_plugins_init(void)
 	struct shared_driver *solib = NULL;
 	struct stat sb;
 
-	if (*default_solib_dir != '\0' && stat(solib->name, &sb) == 0 &&
+	if (*default_solib_dir != '\0' && stat(default_solib_dir, &sb) == 0 &&
 				S_ISDIR(sb.st_mode))
 		eal_plugin_add(default_solib_dir);
 
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Bruce Richardson

The check for the existence of the default plugin directory calls stat using an incorrect variable, which will cause a NULL pointer dereference error.

Coverity issue: 198440

Fixes d6a4399cdfc9 ("eal: avoid error for non-existent default PMD path")

---

Glad I checked the list before going after this one. ;)

#2 lore raw

06/11/2017 21:36, Aaron Conole:

Quoted 6 lines
Quoted 4 lines · Bruce Richardson

The check for the existence of the default plugin directory calls stat using an incorrect variable, which will cause a NULL pointer dereference error.

Quoted 6 lines
Quoted 4 lines

Coverity issue: 198440

Fixes d6a4399cdfc9 ("eal: avoid error for non-existent default PMD path")

Applied, thanks