pj_strcat problems...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, I copied and executed your code. I see seg fault on Windows XP. The
memcpy corresponding to pj_strcat is trying to copy characters from argv[1]
to where it is not supposed to. I do not see any memory alloction preceding
memcpy.

Hari

On Wed, Jan 25, 2012 at 4:44 PM, sjs205 <sjs205.linux at gmail.com> wrote:

> Hello all,
>
> It is probably just me being stupid - I am fairly new to C and pjsip so go
> easy on me - but I'm having some problems with the pj_strcat function. The
> following file just segfaults, can anyone tell me why?:
>
> #include <pjsua.h>
> int main(int argc, char *argv[])
> {
>        const pj_str_t sip_user = pj_str(argv[1]);
>        pj_str_t tmp = {"sip:",4};
>
>        pj_strcat(&tmp, &sip_user);
>
>        printf("STRING: %s ***", tmp);
>    return 0;
> }
>
> BR
>
> Steven
>
>
> ______________________________**_________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/**mailman/listinfo/pjsip_lists.**pjsip.org<http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120125/495498d2/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux