avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [bug #48776] avrdude attempts to free() an invalid address


From: KārlisSeņko
Subject: [avrdude-dev] [bug #48776] avrdude attempts to free() an invalid address
Date: Sat, 9 Sep 2017 13:51:04 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36

Follow-up Comment #5, bug #48776 (project avrdude):

Here is a patch I use.

Index: avrdude/usbtiny.c
===================================================================
--- avrdude/usbtiny.c   (revision 1395)
+++ avrdude/usbtiny.c   (working copy)
@@ -455,6 +455,10 @@
 
   for (; addr < maxaddr; addr += chunk) {
     chunk = PDATA(pgm)->chunk_size;         // start with the maximum chunk
size possible
+    
+    if (chunk > maxaddr - addr) {
+        chunk = maxaddr - addr;
+    }
 
     // Send the chunk of data to the USBtiny with the function we want
     // to perform
@@ -510,6 +514,10 @@
   for (; addr < maxaddr; addr += chunk) {
     // start with the max chunk size
     chunk = PDATA(pgm)->chunk_size;
+    
+    if (chunk > maxaddr - addr) {
+        chunk = maxaddr - addr;
+    }
 
     // we can only write a page at a time anyways
     if (m->paged && chunk > page_size)


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?48776>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]