Commit 4d5895ff authored by Philippe Rouquier's avatar Philippe Rouquier Committed by Philippe Rouquier

Fix #576439 – nautilus crash because of probable double g_free in

2009-03-23  Philippe Rouquier  <bonfire-app@wanadoo.fr>

	Fix #576439 – nautilus crash because of probable double g_free in brasero_medium_get_css_feature

	* libbrasero-media/brasero-medium.c
	(brasero_medium_get_capacity_DVD_RW),
	(brasero_medium_get_speed_mmc3),
	(brasero_medium_get_page_2A_write_speed_desc),
	(brasero_medium_track_set_leadout_DVDR_blank),
	(brasero_medium_get_sessions_info), (brasero_medium_get_contents),
	(brasero_medium_get_css_feature):
	* libbrasero-media/scsi-get-configuration.c
	(brasero_mmc2_get_configuration_feature):
	* libbrasero-media/scsi-get-performance.c:

svn path=/trunk/; revision=2161
parent a025c63f
2009-03-23 Philippe Rouquier <bonfire-app@wanadoo.fr>
Fix #576439 – nautilus crash because of probable double g_free in brasero_medium_get_css_feature
* libbrasero-media/brasero-medium.c
(brasero_medium_get_capacity_DVD_RW),
(brasero_medium_get_speed_mmc3),
(brasero_medium_get_page_2A_write_speed_desc),
(brasero_medium_track_set_leadout_DVDR_blank),
(brasero_medium_get_sessions_info), (brasero_medium_get_contents),
(brasero_medium_get_css_feature):
* libbrasero-media/scsi-get-configuration.c
(brasero_mmc2_get_configuration_feature):
* libbrasero-media/scsi-get-performance.c:
2009-03-22 Luis Medinas <lmedinas@gnome.org>
* data/brasero.schemas.in:
......
......@@ -1167,8 +1167,6 @@ brasero_medium_get_capacity_DVD_RW (BraseroMedium *self,
&size,
code);
if (result != BRASERO_SCSI_OK) {
g_free (hdr);
BRASERO_MEDIA_LOG ("READ FORMAT CAPACITIES failed");
return BRASERO_BURN_ERR;
}
......@@ -1296,8 +1294,6 @@ brasero_medium_get_speed_mmc3 (BraseroMedium *self,
code);
if (result != BRASERO_SCSI_OK) {
g_free (wrt_perf);
BRASERO_MEDIA_LOG ("GET PERFORMANCE failed");
return BRASERO_BURN_ERR;
}
......@@ -1365,8 +1361,6 @@ brasero_medium_get_page_2A_write_speed_desc (BraseroMedium *self,
&size,
code);
if (result != BRASERO_SCSI_OK) {
g_free (data);
BRASERO_MEDIA_LOG ("MODE SENSE failed");
return BRASERO_BURN_ERR;
}
......@@ -1700,8 +1694,6 @@ brasero_medium_track_set_leadout_DVDR_blank (BraseroMedium *self,
&size,
code);
if (result != BRASERO_SCSI_OK) {
g_free (hdr);
BRASERO_MEDIA_LOG ("READ FORMAT CAPACITIES failed");
return BRASERO_BURN_ERR;
}
......@@ -2022,8 +2014,6 @@ brasero_medium_get_sessions_info (BraseroMedium *self,
&size,
code);
if (result != BRASERO_SCSI_OK) {
g_free (toc);
BRASERO_MEDIA_LOG ("READ TOC failed");
return BRASERO_BURN_ERR;
}
......@@ -2240,8 +2230,6 @@ brasero_medium_get_contents (BraseroMedium *self,
&size,
code);
if (result != BRASERO_SCSI_OK) {
g_free (info);
BRASERO_MEDIA_LOG ("READ DISC INFORMATION failed");
return BRASERO_BURN_ERR;
}
......@@ -2554,8 +2542,6 @@ brasero_medium_get_css_feature (BraseroMedium *self,
&size,
code);
if (result != BRASERO_SCSI_OK) {
g_free (hdr);
BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
return BRASERO_BURN_ERR;
}
......
......@@ -171,8 +171,10 @@ brasero_mmc2_get_configuration_feature (BraseroDeviceHandle *handle,
int *size,
BraseroScsiErrCode *error)
{
BraseroScsiGetConfigHdr *hdr = NULL;
BraseroGetConfigCDB *cdb;
BraseroScsiResult res;
int hdr_size = 0;
g_return_val_if_fail (data != NULL, BRASERO_SCSI_FAILURE);
g_return_val_if_fail (size != NULL, BRASERO_SCSI_FAILURE);
......@@ -181,19 +183,20 @@ brasero_mmc2_get_configuration_feature (BraseroDeviceHandle *handle,
BRASERO_SET_16 (cdb->feature_num, type);
cdb->returned_data = BRASERO_GET_CONFIG_RETURN_ONLY_FEATURE;
res = brasero_get_configuration (cdb, data, size, error);
res = brasero_get_configuration (cdb, &hdr, &hdr_size, error);
brasero_scsi_command_free (cdb);
/* make sure the desc is the one we want */
if ((*data) && BRASERO_GET_16 ((*data)->desc->code) != type) {
BRASERO_MEDIA_LOG ("Wrong type returned %d", (*data)->desc->code);
if (hdr && BRASERO_GET_16 (hdr->desc->code) != type) {
BRASERO_MEDIA_LOG ("Wrong type returned %d", hdr->desc->code);
BRASERO_SCSI_SET_ERRCODE (error, BRASERO_SCSI_TYPE_MISMATCH);
g_free (*data);
*size = 0;
g_free (hdr);
return BRASERO_SCSI_FAILURE;
}
*data = hdr;
*size = hdr_size;
return res;
}
......@@ -223,3 +226,4 @@ brasero_mmc2_get_profile (BraseroDeviceHandle *handle,
*profile = BRASERO_GET_16 (hdr.current_profile);
return BRASERO_SCSI_OK;
}
......@@ -197,9 +197,9 @@ brasero_get_performance (BraseroGetPerformanceCDB *cdb,
* than the one they returned on the first time. So redo whole
* operation again but this time with the new size we got */
BRASERO_MEDIA_LOG ("Sizes mismatch asked %i / received %i\n"
"Re-issuing the command with received size",
request_size,
buffer_size);
"Re-issuing the command with received size",
request_size,
buffer_size);
tmp_hdr = &buffer->hdr;
request_size = buffer_size;
......@@ -243,3 +243,4 @@ brasero_mmc3_get_performance_wrt_spd_desc (BraseroDeviceHandle *handle,
brasero_scsi_command_free (cdb);
return res;
}
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