fix(libastro): prevent buffer overflow in obj_description

It shouldn't happen (longest planet names in English are 7 char long, but just in case...).
This commit is contained in:
gitplcc 2023-01-04 16:27:03 +01:00 committed by GitHub
parent 0a1b50503b
commit cc1ef1bfb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ obj_description (Obj *op)
return ("Planet");
if (!biop)
getBuiltInObjs (&biop);
sprintf (nsstr, "Moon of %s", biop[op->pl_code].o_name);
sprintf (nsstr, "Moon of %7s", biop[op->pl_code].o_name);
return (nsstr);
}
case EARTHSAT: