NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/50092 CVS commit: src/external/bsd/nvi



The following reply was made to PR bin/50092; it has been noted by GNATS.

From: Rin Okuyama <okuyama%flex.phys.tohoku.ac.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost, christos%netbsd.org@localhost
Cc: 
Subject: Re: PR/50092 CVS commit: src/external/bsd/nvi
Date: Thu, 26 Nov 2015 08:34:02 +0900

 Thank you for your improvement and commitment of my patches. I shall
 make two comments.
 
 (1) For _ti_readbuf() in libterminfo, cap should always be copied into
 the buffer; caplen can accidentally be same as before.
 
 ======
 --- src/lib/libterminfo/term.c.orig	2015-11-26 08:14:56.000000000 +0900
 +++ src/lib/libterminfo/term.c	2015-11-26 08:15:33.000000000 +0900
 @@ -100,8 +100,8 @@
  		term->_area = realloc(term->_area, term->_arealen);
  		if (term->_area == NULL)
  			return -1;
 -		memcpy(term->_area, cap, term->_arealen);
  	}
 +	memcpy(term->_area, cap, term->_arealen);
  
  	cap = term->_area;
  	len = le16dec(cap);
 ======
 
 (2) For libcurses, screen->unget_list and screen->term should be freed
 when we delete screen.
 
 ======
 --- src/lib/libcurses/screen.c.orig	2015-07-25 09:11:42.000000000 +0900
 +++ src/lib/libcurses/screen.c	2015-07-26 00:06:12.000000000 +0900
 @@ -207,6 +207,9 @@
  	return new_screen;
  
    error_exit:
 +	if (new_screen->term != NULL)
 +		(void)del_curterm(new_screen->term);
 +	free(new_screen->unget_list);
  	free(new_screen);
  	return NULL;
  }
 @@ -239,7 +242,7 @@
  	_cursesi_free_keymap(screen->base_keymap);
  
  	free(screen->stdbuf);
 -	screen->stdbuf = NULL;
 +	free(screen->unget_list);
  	if (_cursesi_screen == screen)
  		_cursesi_screen = NULL;
  	free(screen);
 ======
 
 Thanks,
 Rin
 


Home | Main Index | Thread Index | Old Index