]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - misc.c
Make asynchronous agent_query() requests cancellable.
[PuTTY.git] / misc.c
diff --git a/misc.c b/misc.c
index 06baf8d6fc6304d9b6f95821cb77c50fc3bf4715..5fd58a131550d7f0bd9c5429b9ab4339f8f461d1 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1118,7 +1118,7 @@ void *get_ssh_string(int *datalen, const void **data, int *stringlen)
     if (*datalen < 4)
         return NULL;
     len = GET_32BIT_MSB_FIRST((const unsigned char *)*data);
-    if (*datalen < len+4)
+    if (*datalen - 4 < len)
         return NULL;
     ret = (void *)((const char *)*data + 4);
     *datalen -= len + 4;
@@ -1151,6 +1151,7 @@ int strendswith(const char *s, const char *t)
 char *buildinfo(const char *newline)
 {
     strbuf *buf = strbuf_new();
+    extern const char commitid[];      /* in commitid.c */
 
     strbuf_catf(buf, "Build platform: %d-bit %s",
                 (int)(CHAR_BIT * sizeof(void *)),
@@ -1207,5 +1208,7 @@ char *buildinfo(const char *newline)
     strbuf_catf(buf, "%sBuild option: DEBUG", newline);
 #endif
 
+    strbuf_catf(buf, "%sSource commit: %s", newline, commitid);
+
     return strbuf_to_str(buf);
 }