diff options
Diffstat (limited to 'opentracker.c')
-rw-r--r-- | opentracker.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/opentracker.c b/opentracker.c index f29e076..bfb5c53 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -226,11 +226,10 @@ static void httpresponse( const int64 s, char *data, size_t l ) { | |||
226 | size_t reply_size = 0, reply_off; | 226 | size_t reply_size = 0, reply_off; |
227 | 227 | ||
228 | #ifdef _DEBUG_HTTPERROR | 228 | #ifdef _DEBUG_HTTPERROR |
229 | memcpy( debug_request, data, sizeof( debug_request ) ); | 229 | if( l >= sizeof( debug_request ) ) |
230 | if( l < sizeof( debug_request ) ) | 230 | l = sizeof( debug_request) - 1; |
231 | debug_request[ l ] = 0; | 231 | memcpy( debug_request, data, l ); |
232 | else | 232 | debug_request[ l ] = 0; |
233 | debug_request[ sizeof( debug_request ) - 1 ] = 0; | ||
234 | #endif | 233 | #endif |
235 | 234 | ||
236 | /* This one implicitely tests strlen < 5, too -- remember, it is \n terminated */ | 235 | /* This one implicitely tests strlen < 5, too -- remember, it is \n terminated */ |