diff --git a/creole.c b/creole.c index 0ade012..d053437 100644 --- a/creole.c +++ b/creole.c @@ -14,10 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef CREOLE_TEST # include +# include # include # include "access.h" # include "control_loop_cmds.h" # include "sock.h" +LOG_MODULE_REGISTER(creole, 4); #endif #include "creole.h" @@ -597,7 +599,7 @@ upsilon_sendval(struct creole_env *env, creole_word num) static creole_word upsilon_senddat(struct creole_env *env, creole_word db) { -#define SENDDAT_BUFLEN 128 +#define SENDDAT_BUFLEN 1024 char buf[SENDDAT_BUFLEN]; struct bufptr bp = {buf, 0}; struct creole_word w; @@ -608,6 +610,9 @@ upsilon_senddat(struct creole_env *env, creole_word db) return -EINVAL; buf[bp.left++] = w.word; } + if (r.left != 0) { + return -E2BIG; + } return sock_write_buf(env->fd, &bp); }