What steps will reproduce the problem?
1. Make a call to libopkg's opkg_new without setting an OFFLINE_ROOT.
What is the expected output? What do you see instead?
Expect error list, receive segfault
What version of the product are you using? On what operating system?
0.1.8
Please provide any additional information below.
In file_util.c line 241 (function rm_r) the path variable is not checked for
possible NULL condition. Adding a NULL check allows program to properly return
error list as necessary.
--- opkg-0.1.8/libopkg/file_util.c 2009-12-20 17:02:19.000000000 -0700
+++ opkg-0.1.8-update/libopkg/file_util.c 2011-07-24 16:16:17.439044329 -0700
@@ -238,6 +238,11 @@
DIR *dir;
struct dirent *dent;
+ if( path == NULL ) {
+ opkg_perror(ERROR, "No path specified.");
+ return -1;
+ }
+
dir = opendir(path);
if (dir == NULL) {
opkg_perror(ERROR, "Failed to open dir %s", path);
Original issue reported on code.google.com by scm6...@gmail.com on 24 Jul 2011 at 11:18
Original issue reported on code.google.com by
scm6...@gmail.com
on 24 Jul 2011 at 11:18