Ignore:
Timestamp:
Oct 8, 2013 9:08:13 AM (11 years ago)
Author:
bennylp
Message:

Re #1703: fixing general bugs. First installment: correct handling of snprintf return value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/icedemo.c

    r4537 r4613  
    518518        printed = pj_ansi_snprintf(p, maxlen - (p-buffer),  \ 
    519519                                   fmt, arg0, arg1, arg2, arg3, arg4, arg5); \ 
    520         if (printed <= 0) return -PJ_ETOOSMALL; \ 
     520        if (printed <= 0 || printed >= (int)(maxlen - (p-buffer))) \ 
     521            return -PJ_ETOOSMALL; \ 
    521522        p += printed 
    522523 
Note: See TracChangeset for help on using the changeset viewer.