Skip to content

can not find libnative-lib.so in /proc/self/maps , then crash #44

Description

@tangxianqiang

the source code ``` if ((fd = my_openat(AT_FDCWD, PROC_MAPS, O_RDONLY | O_CLOEXEC, 0)) != 0) {

    while ((read_one_line(fd, map, MAX_LINE)) > 0) {
        for (int i = 0; i < NUM_LIBS; i++) {
            if (my_strstr(map, libstocheck[i]) != NULL) {
                char tmp[MAX_LENGTH] = "";
                char path[MAX_LENGTH] = "";
                char buf[5] = "";
                sscanf(map, "%s %s %s %s %s %s", tmp, buf, tmp, tmp, tmp, path);
                if (buf[2] == 'x') {
                    size_t size = my_strlen(path) + 1;
                    filepaths[i] = malloc(size);
                    my_strlcpy(filepaths[i], path, size);
                    counter++;
                }
            }
        }
        if (counter == NUM_LIBS)
            break;
    }
    my_close(fd);
} ``` will show the different result on the same device.  

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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