mirror of
https://github.com/simh/simh.git
synced 2026-05-02 06:15:23 +00:00
TMXR: Avoid potential NULL pointer dereference after aborted ATTACH
This commit is contained in:
10
sim_tmxr.c
10
sim_tmxr.c
@@ -2407,7 +2407,8 @@ for (i = 0; i < mp->lines; i++) { /* loop thru lines */
|
|||||||
static int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed)
|
static int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed)
|
||||||
{
|
{
|
||||||
if (speed) {
|
if (speed) {
|
||||||
if (lp->send->extoff < lp->send->insoff) {/* buffered SEND data? */
|
if ((lp->send != NULL) &&
|
||||||
|
(lp->send->extoff < lp->send->insoff)) {/* buffered SEND data? */
|
||||||
if (sim_gtime () < lp->send->next_time) /* too soon? */
|
if (sim_gtime () < lp->send->next_time) /* too soon? */
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
@@ -4173,7 +4174,8 @@ for (i=0; i<mp->lines; i++) {
|
|||||||
TMLN *lp = &mp->ldsc[i];
|
TMLN *lp = &mp->ldsc[i];
|
||||||
|
|
||||||
if (uptr == lp->uptr) { /* read polling unit? */
|
if (uptr == lp->uptr) { /* read polling unit? */
|
||||||
if ((lp->send->extoff < lp->send->insoff) &&
|
if ((lp->send != NULL) &&
|
||||||
|
(lp->send->extoff < lp->send->insoff) &&
|
||||||
(sim_gtime_now < lp->send->next_time))
|
(sim_gtime_now < lp->send->next_time))
|
||||||
due = (int32)(lp->send->next_time - sim_gtime_now);
|
due = (int32)(lp->send->next_time - sim_gtime_now);
|
||||||
else {
|
else {
|
||||||
@@ -4725,9 +4727,9 @@ if ((lp->serport == 0) && (lp->sock) && (!lp->datagram))
|
|||||||
fprintf (st, " %s\n", (lp->notelnet) ? "Telnet disabled (RAW data)" : "Telnet protocol");
|
fprintf (st, " %s\n", (lp->notelnet) ? "Telnet disabled (RAW data)" : "Telnet protocol");
|
||||||
if ((!lp->notelnet) && (lp->nomessage))
|
if ((!lp->notelnet) && (lp->nomessage))
|
||||||
fprintf (st, " Telnet connect message disabled\n");
|
fprintf (st, " Telnet connect message disabled\n");
|
||||||
if (lp->send->buffer)
|
if ((lp->send != NULL) && (lp->send->buffer))
|
||||||
sim_show_send_input (st, lp->send);
|
sim_show_send_input (st, lp->send);
|
||||||
if (lp->expect->buf)
|
if ((lp->expect != NULL) && (lp->expect->buf))
|
||||||
sim_exp_showall (st, lp->expect);
|
sim_exp_showall (st, lp->expect);
|
||||||
if (lp->txlog)
|
if (lp->txlog)
|
||||||
fprintf (st, " Logging to %s\n", lp->txlogname);
|
fprintf (st, " Logging to %s\n", lp->txlogname);
|
||||||
|
|||||||
Reference in New Issue
Block a user