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

no limitation for "%s" while calling fscanf() #265

Open
QiAnXinCodeSafe opened this issue Jun 10, 2019 · 1 comment
Open

no limitation for "%s" while calling fscanf() #265

QiAnXinCodeSafe opened this issue Jun 10, 2019 · 1 comment

Comments

@QiAnXinCodeSafe
Copy link

QiAnXinCodeSafe commented Jun 10, 2019

rc = fscanf(ps_file,"%lu %s\n",&ps_pid,dummy_string);

dummy_string defined here:

char dummy_string[PID_MAX_LEN];

macro PID_MAX_LEN defined here:

#define PID_MAX_LEN 64

no limitation for "%s" while calling fscanf() may cause overwrite.

    rc = fscanf(ps_file,"%lu %64s\n",&ps_pid,dummy_string);
@QiAnXinCodeSafe
Copy link
Author

rc = fscanf(ss_file,"%s %d %d %s %s %s\n", dummy_string,&dummy_int,&dummy_int,src_string,dst_string,pid_string);

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