瀏覽代碼

Fix truncation check in (deprecated) mg_upload_field_found

The logic here is inverted. If 'truncated' has been set to 'true' by
mg_snprintf(), then it means the file path was too long.
newsoft 7 年之前
父節點
當前提交
8883ae1c24
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -12072,7 +12072,7 @@ mg_upload_field_found(const char *key,
 	            "%s/%s",
 	            "%s/%s",
 	            fud->destination_dir,
 	            fud->destination_dir,
 	            filename);
 	            filename);
-	if (!truncated) {
+	if (truncated) {
 		mg_cry(fud->conn, "%s: File path too long", __func__);
 		mg_cry(fud->conn, "%s: File path too long", __func__);
 		return FORM_FIELD_STORAGE_ABORT;
 		return FORM_FIELD_STORAGE_ABORT;
 	}
 	}