In avr_read() and avr_write(), only use the paged_load and

paged_write backend functions iff the memory area in question has
a page_size != 0.

This is supposed to fix bug #19234: avrdude-5.3.1 segfaults when
stk500v1 tries to program an ATtiny15


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@739 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2007-05-16 20:15:13 +00:00
parent 6fb700fe6f
commit d95b876d19
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2007-05-16 Joerg Wunsch <j@uriah.heep.sax.de>
* avr.c (avr_read, avr_write): only use the paged_load and
paged_write backend functions iff the memory area in question has
a page_size != 0.
This is supposed to fix bug #19234: avrdude-5.3.1 segfaults when
stk500v1 tries to program an ATtiny15
2007-05-15 Joerg Wunsch <j@uriah.heep.sax.de>
* avr910.c: Fall back to avr_{read,write}_byte_default(). Fixes

4
avr.c
View File

@ -172,7 +172,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
memset(buf, 0xff, size);
if ((strcmp(mem->desc, "flash")==0) || (strcmp(mem->desc, "eeprom")==0)) {
if (pgm->paged_load != NULL) {
if (pgm->paged_load != NULL && mem->page_size != 0) {
/*
* the programmer supports a paged mode read, perhaps more
* efficiently than we can read it directly, so use its routine
@ -569,7 +569,7 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
}
if ((strcmp(m->desc, "flash")==0) || (strcmp(m->desc, "eeprom")==0)) {
if (pgm->paged_write != NULL) {
if (pgm->paged_write != NULL && m->page_size != 0) {
/*
* the programmer supports a paged mode write, perhaps more
* efficiently than we can read it directly, so use its routine