[Git][NTPsec/ntpsec][master] Fix mru crash on partial slot after ^C
Hal Murray
gitlab at mg.gitlab.com
Thu Dec 22 10:51:00 UTC 2016
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
fd505303 by Hal Murray at 2016-12-22T02:49:46-08:00
Fix mru crash on partial slot after ^C
- - - - -
1 changed file:
- pylib/packet.py
Changes:
=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1355,6 +1355,7 @@ class ControlSession:
# Analyze the contents of this response into a span structure
curidx = -1
+ mru = None
for (tag, val) in variables.items():
if self.debug >= 4:
warn("tag=%s, val=%s\n" % (tag, val))
@@ -1381,10 +1382,16 @@ class ControlSession:
if idx != curidx:
# This makes duplicates
curidx = idx
+ if mru:
+ # Can't have partial slots on list
+ # or printing crashes after ^C
+ # Append full slot now
+ span.entries.append(mru)
mru = MRUEntry()
- span.entries.append(mru)
self.slots += 1
setattr(mru, prefix, val)
+ if mru:
+ span.entries.append(mru)
if direct != None:
direct(span.entries)
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fd505303bd14baf88c4f508eadfa0e40c556e2d1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161222/35d67931/attachment.html>
More information about the vc
mailing list