From aed0e688f538340684f2953b1e5ce9ec6a61419d Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 26 Jan 2026 15:01:40 +0000 Subject: [PATCH] C++: Remove uniqueness since it is enforced earlier now. --- cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll b/cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll index e641e50532f..405eb44c7a9 100644 --- a/cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll +++ b/cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll @@ -120,12 +120,8 @@ private int isSource(Expr bufferExpr, Element why) { exists(Variable bufferVar | bufferVar = bufferExpr.(VariableAccess).getTarget() | // buffer is a fixed size array exists(bufferVar.getUnspecifiedType().(ArrayType).getSize()) and - result = - unique(int size | // more generous than .getSize() itself, when the array is a class field or similar. - size = getSize(bufferExpr) - | - size - ) and + // more generous than .getSize() itself, when the array is a class field or similar. + result = getSize(bufferExpr) and why = bufferVar and not memberMayBeVarSize(_, bufferVar) and not exists(BuiltInOperationBuiltInOffsetOf offsetof | offsetof.getAChild*() = bufferExpr) and