raspberry-noaa-v2 icon indicating copy to clipboard operation
raspberry-noaa-v2 copied to clipboard

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

Open jp112sdl opened this issue 8 months ago • 3 comments

If RN2 is installed within another user environment (not 'pi') and the username exceeds 11 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

jp112sdl avatar Oct 03 '23 11:10 jp112sdl

Good catch!

MihajloPi avatar Oct 03 '23 22:10 MihajloPi

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

jp112sdl avatar Oct 04 '23 05:10 jp112sdl

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

albertfilice avatar Mar 26 '24 02:03 albertfilice