Index: wp-includes/class-wp-xmlrpc-server.php
===================================================================
--- wp-includes/class-wp-xmlrpc-server.php	(revision 21548)
+++ wp-includes/class-wp-xmlrpc-server.php	(working copy)
@@ -3953,7 +3953,7 @@
 		$attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
 		if ( is_array( $attachments ) ) {
 			foreach ( $attachments as $file ) {
-				if ( strpos( $post_content, $file->guid ) !== false )
+				if ( isset( $file->guid ) && strpos( $post_content, $file->guid ) !== false )
 					$wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
 			}
 		}
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 21548)
+++ wp-includes/post.php	(working copy)
@@ -3784,6 +3784,10 @@
 		$wpdb->update( $wpdb->posts, compact("post_name"), array( 'ID' => $post_ID ) );
 	}
 
+	// Set GUID
+	if ( ! isset( $guid ) )
+		$wpdb->update ( $wpdb->posts, arrray( 'guid' => get_permalink( $post_ID ) ), array( 'ID' => $post_ID ) );
+
 	wp_set_post_categories($post_ID, $post_category);
 
 	if ( $file )
