dskvr / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

libopkg segfault in cleanup (w/ patch) #81

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
Issue resolved in in SVN, R573

Original comment by scm6...@gmail.com on 25 Jul 2011 at 12:59

GoogleCodeExporter commented 8 years ago

Original comment by graham.g...@gmail.com on 25 Jul 2011 at 11:06