bug #38023: avrdude doesn't return an error code when attempting

to upload an invalid Intel HEX file
* fileio.c (ihex2b): Turn the "No end of file record found" warning
into an error if no valid record was found at all.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1195 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2013-09-02 18:18:15 +00:00
parent 088ae8196a
commit 51da59044e
3 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #38023: avrdude doesn't return an error code when attempting
to upload an invalid Intel HEX file
* fileio.c (ihex2b): Turn the "No end of file record found" warning
into an error if no valid record was found at all.
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
Submitted by Claus-Justus Heine: Submitted by Claus-Justus Heine:

2
NEWS
View File

@ -82,6 +82,8 @@ Current:
is enabled AND target has a very slow clock is enabled AND target has a very slow clock
- bug #39893: Verification failure with AVRISPmkII and Xmega - bug #39893: Verification failure with AVRISPmkII and Xmega
- bug #38713: Compilation of the documentation breaks with texinfo-5 - bug #38713: Compilation of the documentation breaks with texinfo-5
- bug #38023: avrdude doesn't return an error code when attempting
to upload an invalid Intel HEX file
* Keep track of input file contents * Keep track of input file contents

View File

@ -372,12 +372,22 @@ static int ihex2b(char * infile, FILE * inf,
} /* while */ } /* while */
fprintf(stderr, if (maxaddr == 0) {
"%s: WARNING: no end of file record found for Intel Hex " fprintf(stderr,
"file \"%s\"\n", "%s: ERROR: No valid record found in Intel Hex "
progname, infile); "file \"%s\"\n",
progname, infile);
return maxaddr; return -1;
}
else {
fprintf(stderr,
"%s: WARNING: no end of file record found for Intel Hex "
"file \"%s\"\n",
progname, infile);
return maxaddr;
}
} }
static int b2srec(unsigned char * inbuf, int bufsize, static int b2srec(unsigned char * inbuf, int bufsize,