bug #40055: AVRDUDE segfaults when writing eeprom

* main.c: Always clear the UF_AUTO_ERASE flag if either a
non-Xmega device was found, or the programmer does not offer a
page_erase method.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1242 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2013-09-18 05:54:37 +00:00
parent 2c443f466f
commit d292c1a394
3 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #40055: AVRDUDE segfaults when writing eeprom
* main.c: Always clear the UF_AUTO_ERASE flag if either a
non-Xmega device was found, or the programmer does not offer a
page_erase method.
2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2013-09-17 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* configure.ac (AC_INIT): Bump version to post-6.0. * configure.ac (AC_INIT): Bump version to post-6.0.

2
NEWS
View File

@ -17,7 +17,7 @@ Current:
- ... - ...
* Bugfixes * Bugfixes
- bug #XXXX: xxx - bug #40055: AVRDUDE segfaults when writing eeprom
- patch #XXXX: xxx - patch #XXXX: xxx
* Internals: * Internals:

3
main.c
View File

@ -1156,6 +1156,8 @@ int main(int argc, char * argv [])
} else { } else {
AVRMEM * m; AVRMEM * m;
const char *memname = (p->flags & AVRPART_HAS_PDI)? "application": "flash"; const char *memname = (p->flags & AVRPART_HAS_PDI)? "application": "flash";
uflags &= ~UF_AUTO_ERASE;
for (ln=lfirst(updates); ln; ln=lnext(ln)) { for (ln=lfirst(updates); ln; ln=lnext(ln)) {
upd = ldata(ln); upd = ldata(ln);
m = avr_locate_mem(p, upd->memtype); m = avr_locate_mem(p, upd->memtype);
@ -1163,7 +1165,6 @@ int main(int argc, char * argv [])
continue; continue;
if ((strcasecmp(m->desc, memname) == 0) && (upd->op == DEVICE_WRITE)) { if ((strcasecmp(m->desc, memname) == 0) && (upd->op == DEVICE_WRITE)) {
erase = 1; erase = 1;
uflags &= ~UF_AUTO_ERASE;
if (quell_progress < 2) { if (quell_progress < 2) {
fprintf(stderr, fprintf(stderr,
"%s: NOTE: \"%s\" memory has been specified, an erase cycle " "%s: NOTE: \"%s\" memory has been specified, an erase cycle "