mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
If we run out of chat script immediately after a successfully executed
expect-send-expect sequence, finish gracefully, don't core dump. This bug has been there for over a year - I could never reproduce it ! Straw provided by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
This commit is contained in:
parent
67812eacd7
commit
6a32b41413
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48226
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: chat.c,v 1.56 1999/05/27 09:50:10 brian Exp $
|
||||
* $Id: chat.c,v 1.57 1999/06/09 08:47:31 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -181,7 +181,11 @@ chat_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
|
||||
} else {
|
||||
int minus;
|
||||
|
||||
c->argptr = c->argv[++c->arg];
|
||||
if ((c->argptr = c->argv[++c->arg]) == NULL) {
|
||||
/* End of script - all ok */
|
||||
c->state = CHAT_DONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (c->state == CHAT_EXPECT) {
|
||||
/* Look for expect-send-expect sequence */
|
||||
|
Loading…
Reference in New Issue
Block a user