]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check def file name against def_file size (CID #1504299) (#4731)
authorJames Jones <jejones3141@gmail.com>
Wed, 21 Sep 2022 13:53:04 +0000 (08:53 -0500)
committerGitHub <noreply@github.com>
Wed, 21 Sep 2022 13:53:04 +0000 (09:53 -0400)
The check needed to be there... if coverity doesn't realize that
we are now checking, it will still need annotation.

scripts/jlibtool.c

index 5a706ae5d7245bc3600cf7075b593852bfcc2075..0303044dafe3ace0ef4bc9143a700c0f3d3d3233 100644 (file)
@@ -2253,6 +2253,10 @@ static void generate_def_file(command_t *cmd)
 
 
        if (cmd->output_name) {
+               if (strlen(cmd->output_name) + 4 > sizeof(def_file)) {
+                       ERROR("Def file name too long, out of buffer space\n");
+                       return;
+               }
                strcpy(def_file, cmd->output_name);
                strcat(def_file, ".def");
                hDef = fopen(def_file, "w");