Re: [Sofia-sip-devel] msg_header_format issue (?)
2009/1/16 Andrew Rechenberg Lists flux...@resurgent.com: I've got the NTLM code returning a Base 64 encoded auth challenge but when I try to run my gssapi char * variable through msg_header_format the actual value of the variable is being modified/overwritten somehow. Interesting... Can you run your code under valgrind? Sounds like a fandango en core problem... I don't believe so. I'm using Apple XCode's integrated interface to GDB to step through my code (the code has a .ar of the sofia code compiled in and I'm using the iPhone simulator to run my code. I'm modified my code so that the pointer isn't getting overwritten now by memcpy'ing the data into the ar struct, however I still am only getting part of the gssapi-data. The amount of data alloc'd for the Authorization header is well short of what is needed and I only get 4 bytes in the portion of the header I set aside for it (the gssapi-data=%s portion. The %s only has 4 character in it). The idea is to try to print header in a small buffer, and if it does not fit, allocate bigger one. If snprintf() works (and why it should not??), there should be no overflow. I have to be doing something wrong, but I have no idea what. :( What the snprintf() returns on the first round, what is the value it returns? -- Pekka.Pessi mail at nokia.com -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
Re: [Sofia-sip-devel] msg_header_format issue (?)
The idea is to try to print header in a small buffer, and if it does not fit, allocate bigger one. If snprintf() works (and why it should not??), there should be no overflow. What the snprintf() returns on the first round, what is the value it returns? My data gets overwritten before we even get to the vsnprintf. The first msg_header_alloc before the for() loop in msg_header_vformat() in msg_header_make.c is where my stuff is getting overwritten :( To be more precise, my data is fine up until sub_alloc is called in su_alloc which is called from msg_header_alloc. Once I step into sub_alloc() then the value of my Base 64 response variable is modified. Confidentiality Notice: This e-mail message including attachments, if any, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, but do not wish to receive communications through this medium, please so advise the sender immediately. -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
[Sofia-sip-devel] msg_header_format issue (?)
More issues with my NTLM code - again, might be me, but I need some help :) I've got the NTLM code returning a Base 64 encoded auth challenge but when I try to run my gssapi char * variable through msg_header_format the actual value of the variable is being modified/overwritten somehow. It appears to be modified in msg_header_alloc at this code: msg_header_t *h = su_alloc(home, size + extra); Here is the function stack that leads me to that point: auc_authorization auc_ntlm_authorization msg_header_format msg_header_vformat msg_header_alloc Here's my code in auc_ntlm_authorization: http://dpaste.com/hold/109355/ Am I doing something wrong in my code to make this problem occur? Thanks for any pointers (no pun intended :) ), Andy. Confidentiality Notice: This e-mail message including attachments, if any, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, but do not wish to receive communications through this medium, please so advise the sender immediately. -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
Re: [Sofia-sip-devel] msg_header_format issue (?)
2009/1/15 Andrew Rechenberg Lists flux...@resurgent.com: More issues with my NTLM code - again, might be me, but I need some help :) I've got the NTLM code returning a Base 64 encoded auth challenge but when I try to run my gssapi char * variable through msg_header_format the actual value of the variable is being modified/overwritten somehow. Interesting... Can you run your code under valgrind? Sounds like a fandango en core problem... Am I doing something wrong in my code to make this problem occur? This fragment looks perfectly fine to me.. -- Pekka.Pessi mail at nokia.com -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
Re: [Sofia-sip-devel] msg_header_format issue (?)
I've got the NTLM code returning a Base 64 encoded auth challenge but when I try to run my gssapi char * variable through msg_header_format the actual value of the variable is being modified/overwritten somehow. Interesting... Can you run your code under valgrind? Sounds like a fandango en core problem... I don't believe so. I'm using Apple XCode's integrated interface to GDB to step through my code (the code has a .ar of the sofia code compiled in and I'm using the iPhone simulator to run my code. I'm modified my code so that the pointer isn't getting overwritten now by memcpy'ing the data into the ar struct, however I still am only getting part of the gssapi-data. The amount of data alloc'd for the Authorization header is well short of what is needed and I only get 4 bytes in the portion of the header I set aside for it (the gssapi-data=%s portion. The %s only has 4 character in it). I have to be doing something wrong, but I have no idea what. :( Confidentiality Notice: This e-mail message including attachments, if any, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient, but do not wish to receive communications through this medium, please so advise the sender immediately. -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel