summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-02-10 03:20:04 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-02-10 03:20:04 +0000
commit69069125c15decd14dabf0d419c608a9d9021f05 (patch)
tree91328b28cb50c357f40d1c9c76b6cdfbb379666f /pjsip/include
parent9e6bb2202f9bd2da5d61d2e744e6624fc4ed0709 (diff)
Re #1782 (misc): Prevent buffer overrun in pjsip message/uri printing
Thanks to Sagi Iltus for the patch git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4979 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsip/print_util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/print_util.h b/pjsip/include/pjsip/print_util.h
index 6d82aad7..d2ee3aea 100644
--- a/pjsip/include/pjsip/print_util.h
+++ b/pjsip/include/pjsip/print_util.h
@@ -20,6 +20,12 @@
#ifndef __PJSIP_PRINT_H__
#define __PJSIP_PRINT_H__
+#define copy_advance_char_check(buf,chr) \
+ do { \
+ if (1 >= (endbuf-buf)) return -1; \
+ *buf++ = chr; \
+ } while (0)
+
#define copy_advance_check(buf,str) \
do { \
if ((str).slen >= (endbuf-buf)) return -1; \