projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32c8bc4
)
Amended the 'Corrupt message' error with more detail
author
Art Cancro
<ajc@citadel.org>
Mon, 12 Nov 2007 17:15:59 +0000
(17:15 +0000)
committer
Art Cancro
<ajc@citadel.org>
Mon, 12 Nov 2007 17:15:59 +0000
(17:15 +0000)
citadel/modules/network/serv_network.c
patch
|
blob
|
history
diff --git
a/citadel/modules/network/serv_network.c
b/citadel/modules/network/serv_network.c
index cf2bac685bd1c37551ebfafc49765f18ab6d6aec..68ec8d86a874b7db662969f49d03268f42b004cc 100644
(file)
--- a/
citadel/modules/network/serv_network.c
+++ b/
citadel/modules/network/serv_network.c
@@
-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;
}