@@ -123,7 +123,7 @@ bool Cborg::getCBOR(const uint8_t** pointer, uint32_t* length)
123123 {
124124 list.push_back (units);
125125 units = 2 * head.getValue ();
126- } else if (units == maxOf (units)) {
126+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
127127 // We're not making progress. We'll just process the current unit
128128 // endlessly. Something is wrong. We need to bail.
129129 return false ;
@@ -140,7 +140,7 @@ bool Cborg::getCBOR(const uint8_t** pointer, uint32_t* length)
140140 {
141141 list.push_back (units);
142142 units = head.getValue ();
143- } else if (units == maxOf (units)) {
143+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
144144 // We're not making progress. We'll just process the current unit
145145 // endlessly. Something is wrong. We need to bail.
146146 return false ;
@@ -284,7 +284,7 @@ uint32_t Cborg::getCBORLength()
284284 {
285285 list.push_back (units);
286286 units = 2 * head.getValue ();
287- } else if (units == maxOf (units)) {
287+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
288288 // We're not making progress. We'll just process the current unit
289289 // endlessly. Something is wrong. We need to bail.
290290 return false ;
@@ -301,7 +301,7 @@ uint32_t Cborg::getCBORLength()
301301 {
302302 list.push_back (units);
303303 units = head.getValue ();
304- } else if (units == maxOf (units)) {
304+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
305305 // We're not making progress. We'll just process the current unit
306306 // endlessly. Something is wrong. We need to bail.
307307 return false ;
@@ -428,7 +428,7 @@ Cborg Cborg::find(int32_t key) const
428428 {
429429 list.push_back (units);
430430 units = 2 * head.getValue ();
431- } else if (units == maxOf (units)) {
431+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
432432 // We're not making progress. We'll just process the current unit
433433 // endlessly. Something is wrong. We need to bail.
434434 return Cborg (NULL , 0 );
@@ -447,7 +447,7 @@ Cborg Cborg::find(int32_t key) const
447447 {
448448 list.push_back (units);
449449 units = head.getValue ();
450- } else if (units == maxOf (units)) {
450+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
451451 // We're not making progress. We'll just process the current unit
452452 // endlessly. Something is wrong. We need to bail.
453453 return Cborg (NULL , 0 );
@@ -614,7 +614,7 @@ Cborg Cborg::find(const char* key, std::size_t keyLength) const
614614 {
615615 list.push_back (units);
616616 units = 2 * head.getValue ();
617- } else if (units == maxOf (units)) {
617+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
618618 // We're not making progress. We'll just process the current unit
619619 // endlessly. Something is wrong. We need to bail.
620620 return Cborg (NULL , 0 );
@@ -633,7 +633,7 @@ Cborg Cborg::find(const char* key, std::size_t keyLength) const
633633 {
634634 list.push_back (units);
635635 units = head.getValue ();
636- } else if (units == maxOf (units)) {
636+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
637637 // We're not making progress. We'll just process the current unit
638638 // endlessly. Something is wrong. We need to bail.
639639 return Cborg (NULL , 0 );
@@ -814,7 +814,7 @@ Cborg Cborg::getKey(std::size_t index) const
814814 {
815815 list.push_back (units);
816816 units = 2 * head.getValue ();
817- } else if (units == maxOf (units)) {
817+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
818818 // We're not making progress. We'll just process the current unit
819819 // endlessly. Something is wrong. We need to bail.
820820 return Cborg (NULL , 0 );
@@ -831,7 +831,7 @@ Cborg Cborg::getKey(std::size_t index) const
831831 {
832832 list.push_back (units);
833833 units = head.getValue ();
834- } else if (units == maxOf (units)) {
834+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
835835 // We're not making progress. We'll just process the current unit
836836 // endlessly. Something is wrong. We need to bail.
837837 return Cborg (NULL , 0 );
@@ -962,7 +962,7 @@ Cborg Cborg::at(std::size_t index) const
962962 {
963963 list.push_back (units);
964964 units = 2 * head.getValue ();
965- } else if (units == maxOf (units)) {
965+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
966966 // We're not making progress. We'll just process the current unit
967967 // endlessly. Something is wrong. We need to bail.
968968 return Cborg (NULL , 0 );
@@ -979,7 +979,7 @@ Cborg Cborg::at(std::size_t index) const
979979 {
980980 list.push_back (units);
981981 units = head.getValue ();
982- } else if (units == maxOf (units)) {
982+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
983983 // We're not making progress. We'll just process the current unit
984984 // endlessly. Something is wrong. We need to bail.
985985 return Cborg (NULL , 0 );
@@ -1274,7 +1274,7 @@ void Cborg::print() const
12741274
12751275 list.push_back (units);
12761276 units = 2 * head.getValue ();
1277- } else if (units == maxOf (units)) {
1277+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
12781278 // We're not making progress. We'll just process the current unit
12791279 // endlessly. Something is wrong. We need to bail.
12801280 return ;
@@ -1295,7 +1295,7 @@ void Cborg::print() const
12951295
12961296 list.push_back (units);
12971297 units = head.getValue ();
1298- } else if (units == maxOf (units)) {
1298+ } else if (units == maxOf (units) && head. getLength () == 0 ) {
12991299 // We're not making progress. We'll just process the current unit
13001300 // endlessly. Something is wrong. We need to bail.
13011301 return ;
0 commit comments