Checking length of pseudo-drive address to prevent possible overflow

master
Thomas Schmitt 2023-09-12 15:21:17 +02:00
parent 046f581baa
commit ca29b77091
2 changed files with 8 additions and 1 deletions

View File

@ -4461,6 +4461,13 @@ int Cdrskin_driveno_to_btldev(struct CdrskiN *skin, int driveno,
loc= adr;
ret= burn_drive_get_drive_role(skin->drives[driveno].drive);
if(ret!=1) {
if(strlen(adr) > Cdrskin_adrleN - 7) {
fprintf(stderr,
"cdrskin : FAILURE : File path too long for \"stdio:\" prefix: %s\n",
adr);
sprintf(btldev, "stdio:"); /* Address of the null drive */
return(-1);
}
sprintf(btldev,"stdio:%s",adr);
{ret= 2; goto adr_translation;}
}

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2023.06.07.183206"
#define Cdrskin_timestamP "2023.09.12.132011"