summaryrefslogtreecommitdiff
blob: 6c9f2db1d270dedc8a55872bdb763fcc9d56d785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
http://bugs.gentoo.org/297760

--- src-IL/src/il_dicom.c
+++ src-IL/src/il_dicom.c
@@ -427,9 +427,11 @@ ILboolean GetUID(ILubyte *UID)
 		return IL_FALSE;
 
 	ValLen = GetLittleUShort();
+	if (ValLen > 64)
+		return IL_FALSE;
 	if (iread(UID, ValLen, 1) != 1)
 		return IL_FALSE;
-	UID[64] = 0;  // Just to make sure that our string is terminated.
+	UID[ValLen] = 0;  // Just to make sure that our string is terminated.
 
 	return IL_TRUE;
 }