Amended the 'Corrupt message' error with more detail
authorArt Cancro <ajc@citadel.org>
Mon, 12 Nov 2007 17:15:59 +0000 (17:15 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 12 Nov 2007 17:15:59 +0000 (17:15 +0000)
citadel/modules/network/serv_network.c

index cf2bac685bd1c37551ebfafc49765f18ab6d6aec..68ec8d86a874b7db662969f49d03268f42b004cc 100644 (file)
@@ -1359,10 +1359,11 @@ void network_process_buffer(char *buffer, long size) {
        /* Validate just a little bit.  First byte should be FF and
         * last byte should be 00.
         */
-       memcpy(&firstbyte, &buffer[0], 1);
-       memcpy(&lastbyte, &buffer[size-1], 1);
+       firstbyte = buffer[0];
+       lastbyte = buffer[size-1];
        if ( (firstbyte != 255) || (lastbyte != 0) ) {
-               lprintf(CTDL_ERR, "Corrupt message!  Ignoring.\n");
+               lprintf(CTDL_ERR, "Corrupt message ignored.  Length=%ld, firstbyte = %d, lastbyte = %d\n",
+                       size, firstbyte, lastbyte);
                return;
        }