diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx
index e1c4ba5..b74f2e7 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -568,33 +568,32 @@
 
 void CConnection::updateEncodings()
 {
-  int nEncodings = 0;
-  rdr::U32 encodings[encodingMax+3];
+  std::list<rdr::U32> encodings;
 
   if (server.supportsLocalCursor) {
-    encodings[nEncodings++] = pseudoEncodingCursorWithAlpha;
-    encodings[nEncodings++] = pseudoEncodingCursor;
-    encodings[nEncodings++] = pseudoEncodingXCursor;
+    encodings.push_back(pseudoEncodingCursorWithAlpha);
+    encodings.push_back(pseudoEncodingCursor);
+    encodings.push_back(pseudoEncodingXCursor);
   }
   if (server.supportsDesktopResize)
-    encodings[nEncodings++] = pseudoEncodingDesktopSize;
+    encodings.push_back(pseudoEncodingDesktopSize);
   if (server.supportsExtendedDesktopSize)
-    encodings[nEncodings++] = pseudoEncodingExtendedDesktopSize;
+    encodings.push_back(pseudoEncodingExtendedDesktopSize);
   if (server.supportsDesktopRename)
-    encodings[nEncodings++] = pseudoEncodingDesktopName;
+    encodings.push_back(pseudoEncodingDesktopName);
   if (server.supportsLEDState)
-    encodings[nEncodings++] = pseudoEncodingLEDState;
+    encodings.push_back(pseudoEncodingLEDState);
 
-  encodings[nEncodings++] = pseudoEncodingLastRect;
-  encodings[nEncodings++] = pseudoEncodingContinuousUpdates;
-  encodings[nEncodings++] = pseudoEncodingFence;
-  encodings[nEncodings++] = pseudoEncodingQEMUKeyEvent;
+  encodings.push_back(pseudoEncodingLastRect);
+  encodings.push_back(pseudoEncodingContinuousUpdates);
+  encodings.push_back(pseudoEncodingFence);
+  encodings.push_back(pseudoEncodingQEMUKeyEvent);
 
   if (Decoder::supported(preferredEncoding)) {
-    encodings[nEncodings++] = preferredEncoding;
+    encodings.push_back(preferredEncoding);
   }
 
-  encodings[nEncodings++] = encodingCopyRect;
+  encodings.push_back(encodingCopyRect);
 
   /*
    * Prefer encodings in this order:
@@ -604,15 +603,15 @@
 
   if ((preferredEncoding != encodingTight) &&
       Decoder::supported(encodingTight))
-    encodings[nEncodings++] = encodingTight;
+    encodings.push_back(encodingTight);
 
   if ((preferredEncoding != encodingZRLE) &&
       Decoder::supported(encodingZRLE))
-    encodings[nEncodings++] = encodingZRLE;
+    encodings.push_back(encodingZRLE);
 
   if ((preferredEncoding != encodingHextile) &&
       Decoder::supported(encodingHextile))
-    encodings[nEncodings++] = encodingHextile;
+    encodings.push_back(encodingHextile);
 
   // Remaining encodings
   for (int i = encodingMax; i >= 0; i--) {
@@ -625,14 +624,14 @@
       break;
     default:
       if ((i != preferredEncoding) && Decoder::supported(i))
-        encodings[nEncodings++] = i;
+        encodings.push_back(i);
     }
   }
 
   if (server.compressLevel >= 0 && server.compressLevel <= 9)
-      encodings[nEncodings++] = pseudoEncodingCompressLevel0 + server.compressLevel;
+      encodings.push_back(pseudoEncodingCompressLevel0 + server.compressLevel);
   if (server.qualityLevel >= 0 && server.qualityLevel <= 9)
-      encodings[nEncodings++] = pseudoEncodingQualityLevel0 + server.qualityLevel;
+      encodings.push_back(pseudoEncodingQualityLevel0 + server.qualityLevel);
 
-  writer()->writeSetEncodings(nEncodings, encodings);
+  writer()->writeSetEncodings(encodings);
 }
diff --git a/common/rfb/CMsgWriter.cxx b/common/rfb/CMsgWriter.cxx
index 9fe431c..d357c97 100644
--- a/common/rfb/CMsgWriter.cxx
+++ b/common/rfb/CMsgWriter.cxx
@@ -52,13 +52,14 @@
   endMsg();
 }
 
-void CMsgWriter::writeSetEncodings(int nEncodings, rdr::U32* encodings)
+void CMsgWriter::writeSetEncodings(const std::list<rdr::U32> encodings)
 {
+  std::list<rdr::U32>::const_iterator iter;
   startMsg(msgTypeSetEncodings);
   os->skip(1);
-  os->writeU16(nEncodings);
-  for (int i = 0; i < nEncodings; i++)
-    os->writeU32(encodings[i]);
+  os->writeU16(encodings.size());
+  for (iter = encodings.begin(); iter != encodings.end(); ++iter)
+    os->writeU32(*iter);
   endMsg();
 }
 
diff --git a/common/rfb/CMsgWriter.h b/common/rfb/CMsgWriter.h
index 26251e5..4d533d4 100644
--- a/common/rfb/CMsgWriter.h
+++ b/common/rfb/CMsgWriter.h
@@ -23,6 +23,8 @@
 #ifndef __RFB_CMSGWRITER_H__
 #define __RFB_CMSGWRITER_H__
 
+#include <list>
+
 #include <rdr/types.h>
 
 namespace rdr { class OutStream; }
@@ -43,7 +45,7 @@
     void writeClientInit(bool shared);
 
     void writeSetPixelFormat(const PixelFormat& pf);
-    void writeSetEncodings(int nEncodings, rdr::U32* encodings);
+    void writeSetEncodings(const std::list<rdr::U32> encodings);
     void writeSetDesktopSize(int width, int height, const ScreenSet& layout);
 
     void writeFramebufferUpdateRequest(const Rect& r,bool incremental);
