[liboobs] Save UID in a guint32 before passing reference to utils_append_uint()



commit 3a8d8917211cffdd4d28765676626df655f25b3e
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Sat Mar 13 11:07:00 2010 +0100

    Save UID in a guint32 before passing reference to utils_append_uint()
    
    In case uid_t is not of the correct size, we could run into trouble. So ensure we save the value of priv->uid to a guint32 variable before calling utils_append_uint() on it, as it's done in the rest of the code.

 oobs/oobs-selfconfig.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/oobs/oobs-selfconfig.c b/oobs/oobs-selfconfig.c
index 84664ea..12eada6 100644
--- a/oobs/oobs-selfconfig.c
+++ b/oobs/oobs-selfconfig.c
@@ -166,16 +166,18 @@ oobs_self_config_commit (OobsObject *object)
   OobsSelfConfigPrivate *priv;
   DBusMessageIter iter, array_iter;
   DBusMessage *message;
+  guint32 uid;
 
   priv = OOBS_SELF_CONFIG (object)->_priv;
 
   if (!priv->user)
     return;
 
+  uid = priv->uid;
   message = _oobs_object_get_dbus_message (object);
   dbus_message_iter_init_append (message, &iter);
 
-  utils_append_uint (&iter, priv->uid);
+  utils_append_uint (&iter, uid);
 
   /* GECOS fields */
   dbus_message_iter_open_container (&iter,
@@ -205,13 +207,15 @@ oobs_self_config_get_update_message (OobsObject *object)
   OobsSelfConfigPrivate *priv;
   DBusMessageIter iter;
   DBusMessage *message;
+  guint32 uid;
 
   priv = OOBS_SELF_CONFIG (object)->_priv;
 
   message = _oobs_object_get_dbus_message (object);
   dbus_message_iter_init_append (message, &iter);
 
-  utils_append_uint (&iter, priv->uid);
+  uid = priv->uid;
+  utils_append_uint (&iter, uid);
 }
 
 /**



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