Skip to content

Commit d62134b

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

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
@@ -353,7 +353,7 @@ int refname_is_safe(const char *refname)
353353
* For example: refs/foo/../bar is safe but refs/foo/../../bar
354354
* is not.
355355
*/
356-
buf = xmallocz(restlen);
356+
buf = xmallocz(restlen); // CodeQL [SM01952] justification: CodeQL fails to recognize that xmallocz() accounts for the NUL terminator, instead assuming malloc() semantics
357357
result = !normalize_path_copy(buf, rest) && !strcmp(buf, rest);
358358
free(buf);
359359
return result;

0 commit comments

Comments
 (0)