mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 22:45:27 +00:00
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:
@@ -1570,7 +1570,8 @@ int jtag3_open_common(PROGRAMMER *pgm, const char *port) {
|
||||
}
|
||||
|
||||
// Get USB serial number
|
||||
pgm->usbsn = serial_serno();
|
||||
if (serial_serno)
|
||||
pgm->usbsn = serial_serno();
|
||||
|
||||
/*
|
||||
* drain any extraneous input
|
||||
|
@@ -1579,7 +1579,8 @@ static int stk500v2_open(PROGRAMMER *pgm, const char *port) {
|
||||
}
|
||||
|
||||
// Get USB serial number
|
||||
pgm->usbsn = serial_serno();
|
||||
if (serial_serno)
|
||||
pgm->usbsn = serial_serno();
|
||||
|
||||
/*
|
||||
* drain any extraneous input
|
||||
|
Reference in New Issue
Block a user