diff --git a/ChangeLog b/ChangeLog
index 85cf93f5..6484cfb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-09-03  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	bug #39691 Buffer overrun when reading EEPROM byte with JTAGICE3
+	* jtag3.c (jtag3_initialize): initialize the eeprom_pagesize
+	private attribute so the page cache will actually be usable
+
 2013-09-03  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
 
 	bug #38580 Current svn head, xmega and fuses, all fuses tied to fuse0
diff --git a/NEWS b/NEWS
index e88baf4e..fef5093b 100644
--- a/NEWS
+++ b/NEWS
@@ -88,6 +88,7 @@ Current:
       - bug #35800: Compilation error on certain systems if parport is disabled
       - bug #38307: Can't write usersig of an xmega256a3
       - bug #38580 Current svn head, xmega and fuses, all fuses tied to fuse0
+      - bug #39691 Buffer overrun when reading EEPROM byte with JTAGICE3
 
   * Keep track of input file contents
 
diff --git a/jtag3.c b/jtag3.c
index 8724fbc9..f26b64b0 100644
--- a/jtag3.c
+++ b/jtag3.c
@@ -817,6 +817,7 @@ static int jtag3_initialize(PROGRAMMER * pgm, AVRPART * p)
         PDATA(pgm)->flash_pagesize = m->page_size;
 	u16_to_b2(xd.flash_page_size, m->page_size);
       } else if (strcmp(m->desc, "eeprom") == 0) {
+	PDATA(pgm)->eeprom_pagesize = m->page_size;
 	xd.eeprom_page_size = m->page_size;
 	u16_to_b2(xd.eeprom_size, m->size);
 	u32_to_b4(xd.nvm_eeprom_offset, m->offset);