Skip to content

Commit 9526a15

Browse files
committed
ctype: accommodate for CodeQL misinterpreting the z in mallocz()
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 89a5590 commit 9526a15

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎refs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ int refname_is_safe(const char *refname)
396396
* For example: refs/foo/../bar is safe but refs/foo/../../bar
397397
* is not.
398398
*/
399-
buf = xmallocz(restlen);
399+
buf = xmallocz(restlen); // CodeQL [SM01952] justification: CodeQL fails to recognize that xmallocz() accounts for the NUL terminator, instead assuming malloc() semantics
400400
result = !normalize_path_copy(buf, rest) && !strcmp(buf, rest);
401401
free(buf);
402402
return result;

0 commit comments

Comments
 (0)