FreeCalypso > hg > freecalypso-tools
comparison rvinterf/etmsync/pirimei.c @ 1011:6d9b10633f10 default tip
etmsync Pirelli IMEI retrieval: fix poor use of printf()
Bug reported by Vadim Yanitskiy <fixeria@osmocom.org>: the construct
where a static-allocated string was passed to printf() without any
format arguments causes newer compilers to report a security problem.
Given that formatted output is not needed here, just fixed string
output, change printf() to fputs(), and direct the error message
to stderr while at it.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 23 May 2024 17:29:57 +0000 |
parents | 3d148edb87c2 |
children |
comparison
equal
deleted
inserted
replaced
1010:1d144553a5d0 | 1011:6d9b10633f10 |
---|---|
28 if (rc) | 28 if (rc) |
29 return(rc); | 29 return(rc); |
30 cl_des(ciphertext[0], dieid_key, decrypted[0], CL_DES_DECRYPTION); | 30 cl_des(ciphertext[0], dieid_key, decrypted[0], CL_DES_DECRYPTION); |
31 cl_des(ciphertext[1], dieid_key, decrypted[1], CL_DES_DECRYPTION); | 31 cl_des(ciphertext[1], dieid_key, decrypted[1], CL_DES_DECRYPTION); |
32 if (bcmp(decrypted[1], dieid_key, 8)) { | 32 if (bcmp(decrypted[1], dieid_key, 8)) { |
33 printf(failmsg); | 33 fputs(failmsg, stderr); |
34 return(ERROR_TARGET); | 34 return(ERROR_TARGET); |
35 } | 35 } |
36 bcopy(decrypted[0], pirelli_imeisv, 8); | 36 bcopy(decrypted[0], pirelli_imeisv, 8); |
37 printf("Factory IMEISV is %02X%02X%02X%02X-%02X%02X%02X-%02X\n", | 37 printf("Factory IMEISV is %02X%02X%02X%02X-%02X%02X%02X-%02X\n", |
38 pirelli_imeisv[0], pirelli_imeisv[1], pirelli_imeisv[2], | 38 pirelli_imeisv[0], pirelli_imeisv[1], pirelli_imeisv[2], |