alpine 3.8
obsolete weakness #24

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

gammu/src/gammu-1.39.0/gammu/depend/nokia/dct3.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.8 obsolete weakness.

 {
	unsigned char 	buffer[3]  = {0x00,0x01,0xcf};
	unsigned char 	buffer3[8] = {0x00,0x01,0xce,0x1d,0xfe,0x23,0x00,0x00};
	int		i;
	GSM_Error error;

	CheckDCT3();

	error=DCT3_EnableSecurity (gsm, 0x01);
	Print_Error(error);

	if (answer_yes3("Run all tests now ?")) {
		/* make almost all tests */
		error = gsm->Protocol.Functions->WriteMessage(gsm, buffer3, 8, 0x40);
		Print_Error(error);

		GSM_Terminate();

		while (!FALSE) {
			GSM_Init(FALSE);
			if (error==ERR_NONE) break;
			GSM_Terminate();
		}

		usleep(400000);
	}

	gsm->User.UserReplyFunctions=UserReplyFunctions3;

	for (i=0;i<10;i++) {
		error=GSM_WaitFor (gsm, buffer, 3, 0x40, 4, ID_User1);
		if (error == ERR_NONE) break;
	}
}

struct DCT3ADCInfo {
	const char 	*name;
	const char 	*unit;
	int 	x;
	int	pos1;
	int	pos2;
};

static struct DCT3ADCInfo DCT3ADC[] = {
	{"Battery voltage:",			"mV",  1,  3,  2},
/* 	{"Charger voltage:",			"mV",  1, -1,  7}, */
/* 	{"Charger current:",			"mA",  1, -1,  5}, */
	{"Battery type:",			"mAh", 1,  4,  3},
	{"Battery temperature:",		"mK", 10,  5,  4},
/* 	{"Accessory detection:",		"mV",  1, -1, -1}, */ 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.