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

'predict': buffer overflow, if path (including filename) to TLE file is longer than 48 characters #763

Open
jp112sdl opened this issue Oct 3, 2023 · 3 comments

Comments

@jp112sdl
Copy link
Contributor

jp112sdl commented Oct 3, 2023

If RN2 is installed within another user environment (not 'pi') and the username exceeds 9 characters, the path to the TLE file (/home/<username>/raspberry-noaa-v2/tmp/orbit.tle) gets too long and leads to a buffer overflow in predict.

buffer overflow detected : terminated
Aborted

A fix must be implemented in predict:

		if (strcmp(argv[x],"-t")==0)
		{
			z=x+1;
			if (z<=y && argv[z][0] && argv[z][0]!='-')
				strncpy(tle_cli,argv[z],48);
		}

https://github.com/kd2bd/predict/blob/517fccf421909b4974151b6ca30810586ca658a3/predict.c#L6303

@MihajloPi
Copy link
Collaborator

Good catch!

@jp112sdl
Copy link
Contributor Author

jp112sdl commented Oct 4, 2023

Maybe a fast fix could be doing a cd ${NOAA_HOME}/tmp and using predict -t ./orbit.tle (without the full path)

@albertfilice
Copy link

Hitting this, is there a workaround other than moving to a different user?

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