有关malloc的视觉工作室CRT问题(8) [英] visual studio CRT issue for malloc(8)
问题描述
我的应用程序接受最少8个字符&最多16个字符长度的密码,其逻辑在其中一个dll中实现。
Scenario
: 如果用户ID为8个char密码,则它在应用程序中正确登录,但在会话超时后无法重新连接。如果密码是
的9个字符,那么它就会正确重新连接。
通过visual studio 2010,
1。当我使用C / C ++构建dll时 - >代码生成 - >运行时库 - > " Multithreaded
dll "在我的应用程序会话超时后测试重新连接,然后它遇到了方案部分中提到的相同问题。
2。当我使用C / C ++构建dll时 - >代码生成 - >运行时库 - > " Multithreaded
debug dll "并且在我的应用程序会话超时后测试重新连接,然后它可以工作。
请帮助解决此问题的解决方法。
< br style ="font-family:Verdana,Arial,Helvetica,sans-serif; font-size:14px">
提前致谢。
> *场景:*如果用户名为8个char密码,则它在应用程序中正确登录但在会话超时后无法重新连接。如果密码是9个字符,那么它会正确重新连接。
由于你没有显示任何相关代码,因为你只是为8个字符串分配8个字节,在某些情况下,你可能偶然遇到一个空终结符。
显示代码的相关部分。
Dave
通过社区论坛NNTP Server 1.1.55.0" <
Hi,
My application accepts minimum 8 characters & max 16 characters length of password , whose logic is implemented in one of the dll.
Scenario : If there is user id with 8 char password, then it login properly in application but is not able to reconnect after session time-out. whereas if password is of 9 char, then it reconnect properly.
Through visual studio 2010,
1. when i build dll with C/C++ -> Code Generation -> runtime Library -> "Multithreaded dll" and tested reconnect after session time-out of my application , then it was facing the same issue mentioned in the scenario section.
2. when i build dll with C/C++ -> Code Generation -> runtime Library -> "Multithreaded debug dll" and tested reconnect after session time-out of my application , then it works.
Please help how this issue can be resolved.
Thanks in advance.解决方案>*Scenario :* If there is user id with 8 char password, then it login properly in application but is not able to reconnect after session time-out. whereas if password is of 9 char, then it reconnect properly.
As a wild guess since you don't show any relevant code, if you are only allocating 8 bytes for an 8 character string, you're
probably encountering a null terminator by chance in some circumstances.Show the relevant parts of your code.
Dave
这篇关于有关malloc的视觉工作室CRT问题(8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!