[Git][NTPsec/ntpsec][master] decode_searchrange_list can now handle lists without a null-OID terminator

Ian Bruene gitlab at mg.gitlab.com
Fri Jul 21 21:59:39 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
6f50c5bf by Ian Bruene at 2017-07-21T16:47:17-05:00
decode_searchrange_list can now handle lists without a null-OID terminator

- - - - -


1 changed file:

- pylib/agentx.py


Changes:

=====================================
pylib/agentx.py
=====================================
--- a/pylib/agentx.py
+++ b/pylib/agentx.py
@@ -512,11 +512,11 @@ def encode_searchrange_list(oidranges):
     return encoded
 
 
-def decode_searchrange_list(data, flags):
+def decode_searchrange_list(data, flags, expectNullTerm=False):
     oidranges = []
-    while True:
+    while len(data) > 0:
         one, data = decode_oid(data, flags)
-        if isnullOID(one):
+        if (expectNullTerm is True) and isnullOID(one):
             break
         two, data = decode_oid(data, flags)
         oidranges.append({"start": one, "end": two})  # oid, oid, inclusive



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6f50c5bf7a7eb3746b84452fa999e8872bef4564

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6f50c5bf7a7eb3746b84452fa999e8872bef4564
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170721/b5f9029b/attachment.html>


More information about the vc mailing list