chiark / gitweb /
integer and buffer overflows: introduce a number of asserts
[secnet.git] / log.c
diff --git a/log.c b/log.c
index f4ef8000605c866121031ecb4babf2965c2aa1ff..55f1ee125cbfba848002f1c536e8ad89e3bb3247 100644 (file)
--- a/log.c
+++ b/log.c
@@ -25,11 +25,12 @@ static void vMessage(uint32_t class, const char *message, va_list args)
     if (secnet_is_daemon) {
        /* Messages go to the system log interface */
        bp=strlen(buff);
+       assert(bp < MESSAGE_BUFLEN);
        vsnprintf(buff+bp,MESSAGE_BUFLEN-bp,message,args);
        /* Each line is sent separately */
        while ((nlp=strchr(buff,'\n'))) {
            *nlp=0;
-           slilog(system_log,class,buff);
+           slilog(system_log,class,"%s",buff);
            memmove(buff,nlp+1,strlen(nlp+1)+1);
        }
     } else {