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

--- a/src-IL/src/il_dicom.c
+++ b/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;
 }