mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 09:24:55 +00:00
Use correct pmg->type field in WIN32 implementation
Submitted by Adrian Klieber patch #9820: Fix some out-of-bounds/uninitialized issues git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1439 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
@@ -202,10 +202,10 @@ static int pickit2_open(PROGRAMMER * pgm, char * port)
|
||||
HidD_GetProductString(PDATA(pgm)->usb_handle, buff, PGM_DESCLEN-1);
|
||||
|
||||
// convert from wide chars, but do not overwrite trailing '\0'
|
||||
memset(&(pgm->type), 0, PGM_DESCLEN);
|
||||
memset(&(pgm->desc), 0, PGM_DESCLEN);
|
||||
for (i = 0; i < (PGM_DESCLEN-1) && buff[i]; i++)
|
||||
{
|
||||
pgm->type[i] = (char)buff[i]; // TODO what about little/big endian???
|
||||
pgm->desc[i] = (char)buff[i]; // TODO what about little/big endian???
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user