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

Possible Errors #8

Open
raistmaj opened this issue Dec 14, 2016 · 2 comments
Open

Possible Errors #8

raistmaj opened this issue Dec 14, 2016 · 2 comments

Comments

@raistmaj
Copy link

File: swad_mail.c:894
Problem: Variable StrAddresses is used without been initialized. This array is declared as

char StrAddresses[Mai_MAX_LENGTH_STR_ADDR + 1];

If it is not the first email a coma is appended but the first address will be appended to an array containing garbage.

The C standard ensures that at global scope or using static definition the value will be 0, but within a scope, the array must be initialized.

char StrAddresses[Mai_MAX_LENGTH_STR_ADDR + 1] = {0};

File: swad_mark.c:844
Problem: FILE* FileUsrMarks is getting closed twice.

File: swad_indicator.c:1398
Problem: Returning an uninitialized integer. The function Ind_GetNumIndicatorsCrsFromDB is returning the local variable NumIndicatorsFromDB that it may be Uninitialized if the DB_QuerySELECT fails.

File: Various.
Problem: fprintf and family are getting called with the %u string but the variable is a signed integer, this is not a big issue, but it may produce problems if the input comes from an user.

@acanas
Copy link
Owner

acanas commented Dec 15, 2016

Thank you very much for your help. I think all the bugs you reported are fixed in version 16.102.

@Amab
Copy link

Amab commented Nov 17, 2018

Thank you very much for your help. I think all the bugs you reported are fixed in version 16.102.

Maybe this issue should be closed.

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