From 21feb9d996ef324f57e57dff00a109459ab752fe Mon Sep 17 00:00:00 2001 From: intrigus Date: Fri, 27 Mar 2020 15:37:36 +0100 Subject: [PATCH] Add byte slice type --- ql/src/semmle/go/Types.qll | 5 +++++ ql/src/semmle/go/security/XPathInjectionCustomizations.qll | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ql/src/semmle/go/Types.qll b/ql/src/semmle/go/Types.qll index ad87b688fea..c68df092675 100644 --- a/ql/src/semmle/go/Types.qll +++ b/ql/src/semmle/go/Types.qll @@ -328,6 +328,11 @@ class SliceType extends @slicetype, CompositeType { override string toString() { result = "slice type" } } +/** A byte slice type */ +class ByteSliceType extends SliceType { + ByteSliceType() { this.getElementType() instanceof Uint8Type } +} + /** A struct type. */ class StructType extends @structtype, CompositeType { /** diff --git a/ql/src/semmle/go/security/XPathInjectionCustomizations.qll b/ql/src/semmle/go/security/XPathInjectionCustomizations.qll index 2bd3da1cbf3..2f1324e57a3 100644 --- a/ql/src/semmle/go/security/XPathInjectionCustomizations.qll +++ b/ql/src/semmle/go/security/XPathInjectionCustomizations.qll @@ -39,12 +39,6 @@ module XPathInjection { XPathExpressionStringAsSink() { this instanceof XPath::XPathExpressionString::Range } } - // TODO: This probably belongs somewhere, but I'm not sure where - /** The []byte type */ - class ByteSliceType extends SliceType { - ByteSliceType() { this.getElementType() instanceof Uint8Type } - } - //TODO add runes? /** * A call to `filepath.Rel`, considered as a sanitizer for path traversal.