Permalink
Browse files

Fix off=by-one error in out_of_mem (reported by John Hein)

  • Loading branch information...
1 parent 9419d12 commit 752fb61c32e38a3480706a8c2361d39ef8ece8c9 @rc0 committed Mar 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 mairix.c
View
@@ -351,13 +351,13 @@ void out_of_mem(char *file, int line, size_t size)/*{{{*/
p = file;
while (*p) p++;
filelen = p - file;
- write(2, msg1, sizeof(msg1));
+ write(2, msg1, sizeof(msg1)-1);
write(2, file, filelen);
write(2, ":", 1);
emit_int(line);
write(2, ", ", 2);
emit_int(size);
- write(2, msg2, sizeof(msg2));
+ write(2, msg2, sizeof(msg2)-1);
exit(2);
}
/*}}}*/

0 comments on commit 752fb61

Please sign in to comment.