diff options
-rw-r--r-- | src/ipcpd/ipcp.c | 2 | ||||
-rw-r--r-- | src/lib/rib.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 5c1ffd03..617dd11f 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -176,7 +176,7 @@ static int ipcp_rib_readdir(char *** buf) while (info[i] != NULL) { (*buf)[i] = strdup(info[i]); - if (*buf == NULL) + if ((*buf)[i] == NULL) goto fail_dup; i++; } diff --git a/src/lib/rib.c b/src/lib/rib.c index 22b57fb7..78ae82ef 100644 --- a/src/lib/rib.c +++ b/src/lib/rib.c @@ -139,6 +139,10 @@ static int rib_readdir(const char * path, (void) offset; (void) info; + /* Fix ls calling readdir in an infinite loop on raspbian. */ + if (info != NULL && info->nonseekable != 0) + return -ENOENT; + filler(buf, ".", NULL, 0); filler(buf, "..", NULL, 0); |