Print this page
4694 svcs(1) truncates contract ID
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>

@@ -1000,17 +1000,18 @@
                 buf[i] = ~buf[i];
 }
 
 /* CTID */
 #define CTID_COLUMN_WIDTH               6
+#define CTID_COLUMN_BUFSIZE             20      /* max ctid_t + space + \0 */
 
 static void
 sprint_ctid(char **buf, scf_walkinfo_t *wip)
 {
         int r;
         uint64_t c;
-        size_t newsize = (*buf ? strlen(*buf) : 0) + CTID_COLUMN_WIDTH + 2;
+        size_t newsize = (*buf ? strlen(*buf) : 0) + CTID_COLUMN_BUFSIZE;
         char *newbuf = safe_malloc(newsize);
         int restarter_spec;
 
         /*
          * Use the restarter specific get pids routine, if available.