8000 CPP Femtozip Infinite Loop in IntSet.h · Issue #8 · gtoubassi/femtozip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
CPP Femtozip Infinite Loop in IntSet.h #8
Open
@canselcik

Description

@canselcik

When provided with a large quantity of files/data, femtozip gets into an infinite loop. This issue can be tracked down to the insert(int, int*, int*, size_t) method in IntSet.h.

inline int insert(int n, int *b, int *end, size_t capacity) {
    int *p = b + (n % capacity);
    while (*p != -1) {
        if (*p == n) {
            return 0;
        }
        p++;
        if (p == end) {
            p = b;
        }
    }  
    *p = n;
    return 1;
}

The loop while (*p != -1) never completes as p is never equal to -1 or n.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0