Skip to content

Commit ebbfed3

Browse files
authored
Patch for use-after-free (upstream PR me-no-dev#952) (Aircoookie#6)
1 parent 580743f commit ebbfed3

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/me-no-dev/ESPAsyncWebServer.git"
1414
},
15-
"version": "2.0.5",
15+
"version": "2.0.6",
1616
"license": "LGPL-3.0",
1717
"frameworks": "arduino",
1818
"platforms": ["espressif8266", "espressif32"],

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP Async WebServer
2-
version=2.0.5
2+
version=2.0.6
33
author=Me-No-Dev
44
maintainer=Me-No-Dev
55
sentence=Async Web Server for ESP8266 and ESP31B (Aircoookie fork)

src/StringArray.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,19 @@ class LinkedList {
4747

4848
class Iterator {
4949
ItemType* _node;
50+
ItemType* _nextNode = nullptr;
5051
public:
51-
Iterator(ItemType* current = nullptr) : _node(current) {}
52-
Iterator(const Iterator& i) : _node(i._node) {}
53-
Iterator& operator ++() { _node = _node->next; return *this; }
52+
Iterator(ItemType* current = nullptr) : _node(current) {
53+
_nextNode = _node != nullptr ? _node->next : nullptr;
54+
}
55+
Iterator(const Iterator& i) : _node(i._node) {
56+
_nextNode = _node != nullptr ? _node->next : nullptr;
57+
}
58+
Iterator& operator ++() {
59+
_node = _nextNode;
60+
_nextNode = _node != nullptr ? _node->next : nullptr;
61+
return *this;
62+
}
5463
bool operator != (const Iterator& i) const { return _node != i._node; }
5564
const T& operator * () const { return _node->value(); }
5665
const T* operator -> () const { return &_node->value(); }

0 commit comments

Comments
 (0)