brasero r2160 - in branches/gnome-2-26: . libbrasero-media



Author: philippr
Date: Mon Mar 23 19:49:04 2009
New Revision: 2160
URL: http://svn.gnome.org/viewvc/brasero?rev=2160&view=rev

Log:
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:


Modified:
   branches/gnome-2-26/ChangeLog
   branches/gnome-2-26/libbrasero-media/brasero-medium.c
   branches/gnome-2-26/libbrasero-media/scsi-get-configuration.c
   branches/gnome-2-26/libbrasero-media/scsi-get-performance.c

Modified: branches/gnome-2-26/libbrasero-media/brasero-medium.c
==============================================================================
--- branches/gnome-2-26/libbrasero-media/brasero-medium.c	(original)
+++ branches/gnome-2-26/libbrasero-media/brasero-medium.c	Mon Mar 23 19:49:04 2009
@@ -1167,8 +1167,6 @@
 						      &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 @@
 							    code);
 
 	if (result != BRASERO_SCSI_OK) {
-		g_free (wrt_perf);
-
 		BRASERO_MEDIA_LOG ("GET PERFORMANCE failed");
 		return BRASERO_BURN_ERR;
 	}
@@ -1365,8 +1361,6 @@
 						   &size,
 						   code);
 	if (result != BRASERO_SCSI_OK) {
-		g_free (data);
-
 		BRASERO_MEDIA_LOG ("MODE SENSE failed");
 		return BRASERO_BURN_ERR;
 	}
@@ -1700,8 +1694,6 @@
 						      &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 @@
 						  &size,
 						  code);
 	if (result != BRASERO_SCSI_OK) {
-		g_free (toc);
-
 		BRASERO_MEDIA_LOG ("READ TOC failed");
 		return BRASERO_BURN_ERR;
 	}
@@ -2240,8 +2230,6 @@
 							 &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 @@
 							 &size,
 							 code);
 	if (result != BRASERO_SCSI_OK) {
-		g_free (hdr);
-
 		BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
 		return BRASERO_BURN_ERR;
 	}

Modified: branches/gnome-2-26/libbrasero-media/scsi-get-configuration.c
==============================================================================
--- branches/gnome-2-26/libbrasero-media/scsi-get-configuration.c	(original)
+++ branches/gnome-2-26/libbrasero-media/scsi-get-configuration.c	Mon Mar 23 19:49:04 2009
@@ -171,8 +171,10 @@
 					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_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 @@
 	*profile = BRASERO_GET_16 (hdr.current_profile);
 	return BRASERO_SCSI_OK;
 }
+

Modified: branches/gnome-2-26/libbrasero-media/scsi-get-performance.c
==============================================================================
--- branches/gnome-2-26/libbrasero-media/scsi-get-performance.c	(original)
+++ branches/gnome-2-26/libbrasero-media/scsi-get-performance.c	Mon Mar 23 19:49:04 2009
@@ -197,9 +197,9 @@
 		 * 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_scsi_command_free (cdb);
 	return res;
 }
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]