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

getNodeIpList crashes #13

Open
wilricknl opened this issue Apr 3, 2024 · 2 comments
Open

getNodeIpList crashes #13

wilricknl opened this issue Apr 3, 2024 · 2 comments

Comments

@wilricknl
Copy link

wilricknl commented Apr 3, 2024

Hi, not sure what this line is trying to achieve, but it crashes my application when querying a node ip list.

memset(&result, 0, sizeof(CurrentTickInfo));

You can reproduce it with the following command:

qubic-cli.exe -nodeip "62.2.98.74" -getnodeiplist

Possible fix:

Simply removing the above line.

@wilricknl
Copy link
Author

Another issue with printSystemInfoFromNode in this line:

char hex[64];

Issue:

Crashes upon log, because hex is not null-terminated.

Reproduction

qubic-cli.exe -nodeip "62.2.98.74" -getsysteminfo

Possible fix:

char hex[65];
hex[64] = '\0';

At first I just wanted to just open an issue, because I didn't see a point in an MR for 1 line, but maybe I will make an MR if I run into more stuff.

@wilricknl
Copy link
Author

Also a null-termination bug in parsing the seed from a config file.

Line:

g_seed = (char*) malloc(55);

Possible fix:

g_seed = (char*)malloc(56);
memset(g_seed, 0, 56);

cyber-pc pushed a commit to cyber-pc/qubic-cli that referenced this issue May 7, 2024
Merge Release/ep84 to main (v1.181.0)
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

1 participant