Project

General

Profile

Bug #17810 ยป ruby-addr2line-do-not-overwrite-sname-with-null.patch

Do not overwrite sname with NULL - xtkoba (Tee KOBAYASHI), 04/17/2021 06:36 AM

View differences:

addr2line.c
2318 2320
	    /* if the binary is strip-ed, this may effect */
2319 2321
	    for (p=dladdr_fbases; *p; p++) {
2320 2322
		if (*p == info.dli_fbase) {
2321
		    lines[i].path = info.dli_fname;
2322
		    lines[i].sname = info.dli_sname;
2323
		    if (info.dli_fname) lines[i].path = info.dli_fname;
2324
		    if (info.dli_sname) lines[i].sname = info.dli_sname;
2323 2325
		    goto next_line;
2324 2326
		}
2325 2327
	    }
......
2329 2331
	    obj->base_addr = (uintptr_t)info.dli_fbase;
2330 2332
	    path = info.dli_fname;
2331 2333
	    obj->path = path;
2332
	    lines[i].path = path;
2333
            lines[i].sname = info.dli_sname;
2334
            lines[i].saddr = (uintptr_t)info.dli_saddr;
2334
	    if (path) lines[i].path = path;
2335
            if (info.dli_sname) {
2336
                lines[i].sname = info.dli_sname;
2337
                lines[i].saddr = (uintptr_t)info.dli_saddr;
2338
            }
2335 2339
	    strlcpy(binary_filename, path, PATH_MAX);
2336 2340
	    if (fill_lines(num_traces, traces, 1, &obj, lines, i) == (uintptr_t)-1)
2337 2341
		break;