[LGTM] gotify 검사하기
LGTM : 코드 분석 후 결과를 정리해주는 애플리케이션
코드 검사를 위해 우상단 [Project list]를 클릭한다.
프로젝트 입력칸에 검사하고 싶은 저장소를 넣으면 된다.
검사 대상
scrcpy: https://github.com/Genymobile/scrcpy ( C, Java)
Uptime Kuma: https://github.com/louislam/uptime-kuma (JavaScript)
gotify/server: https://github.com/gotify/server (Golang)
이번 포스팅엔 gotify/server를 검사 할거다.
나머지는 다음 포스팅에
3개 다 넣었다.
gotify부터 봐보자
위험 : 1, 추천 : 1 ?
정수 유형 간의 잘못된 변환
[Show Path]로 들어가면 어떻게 해결해야 하는지 알려준다.
상한 검사 없이 64비트 정수를 strconv.ParseUint에서 더 낮은 비트 크기 유형 uint로 잘못 변환했습니다.
비유하자면 long long 자료형인데 int 자료형으로 사용했다?
관련 CWE => CWE-190
정수 오버플로 또는 랩어라운드
https://cwe.mitre.org/data/definitions/190.html
CWE - CWE-190: Integer Overflow or Wraparound (4.6)
div.collapseblock { display:inline} CWE-190: Integer Overflow or WraparoundWeakness ID: 190 Abstraction: BaseStructure: SimpleStatus: Stable The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that
cwe.mitre.org
관련 CWE => CWE-681
숫자 유형 간의 잘못된 변환
https://cwe.mitre.org/data/definitions/681.html
CWE - CWE-681: Incorrect Conversion between Numeric Types (4.6)
div.collapseblock { display:inline} CWE-681: Incorrect Conversion between Numeric TypesWeakness ID: 681 Abstraction: BaseStructure: SimpleStatus: Draft When converting from one data type to another, such as long to integer, data can be omitted or translate
cwe.mitre.org
구문 오류
[36eb8d8]에 들어가보면
어디가 잘못된거지..?