Index: /trunk/include/VBox/HostServices/GuestPropertySvc.h
===================================================================
--- /trunk/include/VBox/HostServices/GuestPropertySvc.h	(revision 70220)
+++ /trunk/include/VBox/HostServices/GuestPropertySvc.h	(revision 70221)
@@ -164,11 +164,10 @@
 /**
  * Write out flags to a string.
- *
  * @returns  IPRT status code
- * @param    fFlags    The flags to write out.
- * @param    pszFlags  Where to write the flags string.
- * @param    cbFlags   The size of the destination buffer (in bytes).
- */
-DECLINLINE(int) GuestPropWriteFlags(uint32_t fFlags, char* pszFlags, size_t cbFlags)
+ * @param    fFlags    the flags to write out
+ * @param    pszFlags  where to write the flags string.  This must point to
+ *                     a buffer of size (at least) MAX_FLAGS_LEN.
+ */
+DECLINLINE(int) GuestPropWriteFlags(uint32_t fFlags, char *pszFlags)
 {
     /* Putting READONLY before the other RDONLY flags keeps the result short. */
@@ -180,10 +179,7 @@
 
     AssertLogRelReturn(VALID_PTR(pszFlags), VERR_INVALID_POINTER);
-    AssertLogRelReturn(cbFlags,             VERR_INVALID_PARAMETER);
-
-    pszFlags[0] = '\0';
-
     if ((fFlags & ~GUEST_PROP_F_ALLFLAGS) == GUEST_PROP_F_NILFLAG)
     {
+        char *pszNext;
         unsigned i;
 
@@ -193,22 +189,20 @@
             fFlags |= GUEST_PROP_F_TRANSIENT;
 
+        pszNext = pszFlags;
         for (i = 0; i < RT_ELEMENTS(s_aFlagList); ++i)
         {
             if (s_aFlagList[i] == (fFlags & s_aFlagList[i]))
             {
-                rc = RTStrCat(pszFlags, cbFlags, GuestPropFlagName(s_aFlagList[i]));
-                if (RT_FAILURE(rc))
-                    break;
-
+                strcpy(pszNext, GuestPropFlagName(s_aFlagList[i]));
+                pszNext += GuestPropFlagNameLen(s_aFlagList[i]);
                 fFlags &= ~s_aFlagList[i];
-
                 if (fFlags != GUEST_PROP_F_NILFLAG)
                 {
-                    rc = RTStrCat(pszFlags, cbFlags, ", ");
-                    if (RT_FAILURE(rc))
-                        break;
+                    strcpy(pszNext, ", ");
+                    pszNext += 2;
                 }
             }
         }
+        *pszNext = '\0';
 
         Assert(fFlags == GUEST_PROP_F_NILFLAG); /* bad s_aFlagList */
Index: /trunk/src/VBox/HostServices/GuestProperties/service.cpp
===================================================================
--- /trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 70220)
+++ /trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 70221)
@@ -619,5 +619,5 @@
     {
         char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-        rc = GuestPropWriteFlags(pProp->mFlags, szFlags, sizeof(szFlags));
+        rc = GuestPropWriteFlags(pProp->mFlags, szFlags);
         if (RT_SUCCESS(rc))
         {
@@ -857,5 +857,5 @@
 
     char            szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-    int rc = GuestPropWriteFlags(pProp->mFlags, szFlags, sizeof(szFlags));
+    int rc = GuestPropWriteFlags(pProp->mFlags, szFlags);
     if (RT_FAILURE(rc))
         return rc;
@@ -1016,5 +1016,5 @@
     {
         char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-        rc = GuestPropWriteFlags(prop.mFlags, szFlags, sizeof(szFlags));
+        rc = GuestPropWriteFlags(prop.mFlags, szFlags);
         if (RT_SUCCESS(rc))
         {
@@ -1215,5 +1215,5 @@
             /* Send out a host notification */
             const char *pszValue = prop.mValue.c_str();
-            rc = GuestPropWriteFlags(prop.mFlags, szFlags, sizeof(szFlags));
+            rc = GuestPropWriteFlags(prop.mFlags, szFlags);
             if (RT_SUCCESS(rc))
                 rc = notifyHost(pszProperty, pszValue, u64Timestamp, szFlags);
@@ -1406,5 +1406,5 @@
 
     char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-    int rc = GuestPropWriteFlags(pProp->mFlags, szFlags, sizeof(szFlags));
+    int rc = GuestPropWriteFlags(pProp->mFlags, szFlags);
     if (RT_FAILURE(rc))
         RTStrPrintf(szFlags, sizeof(szFlags), "???");
Index: /trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
===================================================================
--- /trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp	(revision 70220)
+++ /trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp	(revision 70221)
@@ -120,5 +120,5 @@
         if (RT_SUCCESS(rc))
         {
-            rc = GuestPropWriteFlags(fFlags, pszFlagBuffer, GUEST_PROP_MAX_FLAGS_LEN);
+            rc = GuestPropWriteFlags(fFlags, pszFlagBuffer);
             if (RT_FAILURE(rc))
                 RTTestIFailed("Failed to convert flag string '%s' back to a string.",
@@ -159,5 +159,5 @@
         RTTestISub("Rejection of an invalid flags field");
         /* This is required to fail. */
-        if (RT_SUCCESS(GuestPropWriteFlags(u32BadFlags, pszFlagBuffer, GUEST_PROP_MAX_FLAGS_LEN)))
+        if (RT_SUCCESS(GuestPropWriteFlags(u32BadFlags, pszFlagBuffer)))
         {
             RTTestIFailed("Flags 0x%x were incorrectly written out as '%.*s'\n",
@@ -828,5 +828,5 @@
     {
         char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-        if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags, sizeof(szFlags))))
+        if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags)))
             RTTestIFailed("Failed to set the global flags.");
         else
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 70220)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 70221)
@@ -5976,5 +5976,5 @@
     {
         char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-        if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags, sizeof(szFlags))))
+        if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags)))
             Log(("Failed to set the global flags.\n"));
         else
Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 70220)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 70221)
@@ -5655,5 +5655,5 @@
         aValue = it->second.strValue;
         *aTimestamp = it->second.mTimestamp;
-        GuestPropWriteFlags(it->second.mFlags, szFlags, sizeof(szFlags));
+        GuestPropWriteFlags(it->second.mFlags, szFlags);
         aFlags = Utf8Str(szFlags);
     }
@@ -5937,5 +5937,5 @@
         aValues[i] = it->second.strValue;
         aTimestamps[i] = it->second.mTimestamp;
-        GuestPropWriteFlags(it->second.mFlags, szFlags, sizeof(szFlags));
+        GuestPropWriteFlags(it->second.mFlags, szFlags);
         aFlags[i] = Utf8Str(szFlags);
     }
@@ -10453,5 +10453,5 @@
             prop.timestamp = property.mTimestamp;
             char szFlags[GUEST_PROP_MAX_FLAGS_LEN + 1];
-            GuestPropWriteFlags(property.mFlags, szFlags, sizeof(szFlags));
+            GuestPropWriteFlags(property.mFlags, szFlags);
             prop.strFlags = szFlags;
 
@@ -13538,5 +13538,5 @@
         if (it->second.mFlags)
         {
-            GuestPropWriteFlags(it->second.mFlags, szFlags, sizeof(szFlags));
+            GuestPropWriteFlags(it->second.mFlags, szFlags);
             aFlags[i] = szFlags;
         }
