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:
Joerg Wunsch 2020-09-16 21:13:24 +00:00
parent b23c506cbd
commit acd2aa6417
1 changed files with 2 additions and 2 deletions

View File

@ -202,10 +202,10 @@ static int pickit2_open(PROGRAMMER * pgm, char * port)
HidD_GetProductString(PDATA(pgm)->usb_handle, buff, PGM_DESCLEN-1); HidD_GetProductString(PDATA(pgm)->usb_handle, buff, PGM_DESCLEN-1);
// convert from wide chars, but do not overwrite trailing '\0' // 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++) 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 #else