Check whether serial_serno is not NULL before calling it.

For devices connected through a real serial device rather than
USB, there is no transport-layer serial number available.

stk500v2.c (and jtag3.c) tried to always call this function.

Closes #1254
This commit is contained in:
Joerg Wunsch 2023-01-01 22:23:44 +01:00
parent b2c03f5d40
commit 06e999b8c5
3 changed files with 5 additions and 2 deletions

1
NEWS
View File

@ -122,6 +122,7 @@ Changes since version 7.0:
- megaAVR JTAG programming doesn't work for SNAP and PICkit4 - megaAVR JTAG programming doesn't work for SNAP and PICkit4
#1052 #1052
- urclock/FTDI communication issues #1245 - urclock/FTDI communication issues #1245
- stk500v2.c dumps core on open #1254
* Pull requests: * Pull requests:

View File

@ -1570,6 +1570,7 @@ int jtag3_open_common(PROGRAMMER *pgm, const char *port) {
} }
// Get USB serial number // Get USB serial number
if (serial_serno)
pgm->usbsn = serial_serno(); pgm->usbsn = serial_serno();
/* /*

View File

@ -1579,6 +1579,7 @@ static int stk500v2_open(PROGRAMMER *pgm, const char *port) {
} }
// Get USB serial number // Get USB serial number
if (serial_serno)
pgm->usbsn = serial_serno(); pgm->usbsn = serial_serno();
/* /*