check loaded files before accessing them

parent 1069eeb7
......@@ -586,21 +586,21 @@ tus_file_add(struct VPFX(tus_server) *srv, int basefd, const char *filename)
goto err;
}
err = tus_file_disk_err(fdisk);
if (err != NULL) {
fprintf(stderr, "tus add %s: %s\n", filename, err);
goto err;
}
/*
* we do not read in final concats because they do not need relevant
* amounts of date for re-upload
* amounts of data for re-upload
*/
if (fdisk->type == TUS_FINAL) {
fprintf(stderr, "tus add %s: is final\n", filename);
goto err;
}
err = tus_file_disk_err(fdisk);
if (err != NULL) {
fprintf(stderr, "tus add %s: %s\n", filename, err);
goto err;
}
if (fdisk->upload_expires < VTIM_real()) {
fprintf(stderr, "tus add %s: expired\n", filename);
goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment