DynamoRIO / DynamoRIO/dynamorio

shared_library_error calls dlerror even when loading via private loader

Open
#809 0 comments 0 reactions 0 assignees View on GitHub
Migrated Priority-Medium
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

_From [rnk@google.com](https://code.google.com/u/rnk@google.com/) on June 14, 2012 16:03:06_

Don't have time to send a quick CL for this now, but I just hit this:

409 client_lib = load_shared_library(path);
410 if (client_lib == NULL) {
411 char msg[MAXIMUM_PATH_4];
412 char err[MAXIMUM_PATH_2];
413 shared_library_error(err, BUFFER_SIZE_ELEMENTS(err));

3176 shared_library_error(char _buf, int maxlen)
3177 {
3178 char *err = dlerror(); // err can be NULL
3179 strncpy(buf, err, maxlen-1); // crash in strncpy reading err
3180 buf[maxlen-1] = '\0'; /_ strncpy won't put on trailing null if maxes out */
3181 }

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=809_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.