Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug ? strack is break with protobuf 3.0.0 ver #3329

Closed
huangzuduan opened this issue Jul 7, 2017 · 1 comment
Closed

bug ? strack is break with protobuf 3.0.0 ver #3329

huangzuduan opened this issue Jul 7, 2017 · 1 comment

Comments

@huangzuduan
Copy link

syntax = "proto2";

package msg;

message SerivceInfo2
{
optional uint32 ServerID = 1;
optional string ServerName= 2;
optional bool Recvsrvlist = 3;
optional bool Broadcastlist = 4;
optional uint32 SerivceID = 5;
optional string SerivceName= 6;
optional string SerivceFun = 7;
optional string SerivceIP = 8;
optional uint32 SerivcePort = 9;
optional uint32 SerivceRemoteid = 10;
optional string SerivceUser = 11;
optional string SerivcePasswd = 12;
optional string SerivceValue = 13;

}
///------------------------------------------------------
::msg::SerivceInfo2 proto;
proto.set_servername("123");
std::string name = proto.servername();
///--------------------------------------------------------
// if you set string field , Run-Time Check Failure #2 - Stack around the variable 'proto' was corrupted.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 7, 2017

This sounds like a build issue. Your program is probably built with incorrect configurations (e.g., different compiler flags are used when compiling protobuf library and your own code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants