View | Details | Raw Unified | Return to bug 23150
Collapse All | Expand All

(-)elfcore.c (-1 / +2 lines)
Lines 455-461 readmap(pid_t pid) Link Here
455
	bufsize = 8 * 1024;
455
	bufsize = 8 * 1024;
456
	mapbuf = NULL;
456
	mapbuf = NULL;
457
	for ( ; ; ) {
457
	for ( ; ; ) {
458
		if ((mapbuf = realloc(mapbuf, bufsize)) == NULL)
458
		if ((mapbuf = realloc(mapbuf, bufsize + 1)) == NULL)
459
			errx(1, "out of memory");
459
			errx(1, "out of memory");
460
		mapsize = read(mapfd, mapbuf, bufsize);
460
		mapsize = read(mapfd, mapbuf, bufsize);
461
		if (mapsize != -1 || errno != EFBIG)
461
		if (mapsize != -1 || errno != EFBIG)
Lines 470-475 readmap(pid_t pid) Link Here
470
		errx(1, "empty map file %s", mapname);
470
		errx(1, "empty map file %s", mapname);
471
	close(mapfd);
471
	close(mapfd);
472
472
473
	mapbuf[mapsize] = 0;
473
	pos = 0;
474
	pos = 0;
474
	map = NULL;
475
	map = NULL;
475
	linkp = ↦
476
	linkp = ↦

Return to bug 23150