Skip to content

Commit 4ddb4a0

Browse files
committed
ctype: accommodate for CodeQL misinterpreting the z in mallocz()
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent abb8a50 commit 4ddb4a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refs.c

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

0 commit comments

Comments
 (0)