gvfs r2263 - in trunk: . client
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r2263 - in trunk: . client
- Date: Mon, 2 Mar 2009 08:36:39 +0000 (UTC)
Author: alexl
Date: Mon Mar 2 08:36:39 2009
New Revision: 2263
URL: http://svn.gnome.org/viewvc/gvfs?rev=2263&view=rev
Log:
2009-03-02 Alexander Larsson <alexl redhat com>
Bug 573371 â Unsafe g_htonl() macro expansion
* client/gdaemonfileoutputstream.c (append_request):
* client/gdaemonfileinputstream.c (append_request):
Don't use ++ inside macro that may evaluate twice.
Modified:
trunk/ChangeLog
trunk/client/gdaemonfileinputstream.c
trunk/client/gdaemonfileoutputstream.c
Modified: trunk/client/gdaemonfileinputstream.c
==============================================================================
--- trunk/client/gdaemonfileinputstream.c (original)
+++ trunk/client/gdaemonfileinputstream.c Mon Mar 2 08:36:39 2009
@@ -406,11 +406,13 @@
*seq_nr = stream->seq_nr;
cmd.command = g_htonl (command);
- cmd.seq_nr = g_htonl (stream->seq_nr++);
+ cmd.seq_nr = g_htonl (stream->seq_nr);
cmd.arg1 = g_htonl (arg1);
cmd.arg2 = g_htonl (arg2);
cmd.data_len = g_htonl (data_len);
+ stream->seq_nr++;
+
g_string_append_len (stream->output_buffer,
(char *)&cmd, G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SIZE);
}
Modified: trunk/client/gdaemonfileoutputstream.c
==============================================================================
--- trunk/client/gdaemonfileoutputstream.c (original)
+++ trunk/client/gdaemonfileoutputstream.c Mon Mar 2 08:36:39 2009
@@ -327,11 +327,13 @@
*seq_nr = stream->seq_nr;
cmd.command = g_htonl (command);
- cmd.seq_nr = g_htonl (stream->seq_nr++);
+ cmd.seq_nr = g_htonl (stream->seq_nr);
cmd.arg1 = g_htonl (arg1);
cmd.arg2 = g_htonl (arg2);
cmd.data_len = g_htonl (data_len);
+ stream->seq_nr++;
+
g_string_append_len (stream->output_buffer,
(char *)&cmd, G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SIZE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]