@@ -146,6 +146,9 @@ class StrCopyBW extends BufferWriteCall {
146146 )
147147 }
148148
149+ /**
150+ * Gets the index of the parameter that is the maximum size of the copy (in characters).
151+ */
149152 int getParamSize ( ) {
150153 exists ( TopLevelFunction fn , string name |
151154 fn = getTarget ( ) and
@@ -161,6 +164,9 @@ class StrCopyBW extends BufferWriteCall {
161164 )
162165 }
163166
167+ /**
168+ * Gets the index of the parameter that is the source of the copy.
169+ */
164170 int getParamSrc ( ) {
165171 exists ( TopLevelFunction fn , string name |
166172 fn = getTarget ( ) and
@@ -194,8 +200,14 @@ class StrCopyBW extends BufferWriteCall {
194200class StrCatBW extends BufferWriteCall {
195201 StrCatBW ( ) { exists ( TopLevelFunction fn | fn = getTarget ( ) and fn instanceof StrcatFunction ) }
196202
203+ /**
204+ * Gets the index of the parameter that is the maximum size of the copy (in characters).
205+ */
197206 int getParamSize ( ) { if exists ( getArgument ( 2 ) ) then result = 2 else none ( ) }
198207
208+ /**
209+ * Gets the index of the parameter that is the source of the copy.
210+ */
199211 int getParamSrc ( ) { result = 1 }
200212
201213 override Type getBufferType ( ) {
@@ -349,6 +361,9 @@ class SnprintfBW extends BufferWriteCall {
349361 )
350362 }
351363
364+ /**
365+ * Gets the index of the parameter that is the size of the destination (in characters).
366+ */
352367 int getParamSize ( ) { result = 1 }
353368
354369 override Type getBufferType ( ) {
@@ -399,6 +414,9 @@ class GetsBW extends BufferWriteCall {
399414 )
400415 }
401416
417+ /**
418+ * Gets the index of the parameter that is the maximum number of characters to be read.
419+ */
402420 int getParamSize ( ) { if exists ( getArgument ( 1 ) ) then result = 1 else none ( ) }
403421
404422 override Type getBufferType ( ) { result = this .getTarget ( ) .getParameter ( 0 ) .getUnspecifiedType ( ) }
@@ -434,6 +452,9 @@ class ScanfBW extends BufferWrite {
434452 )
435453 }
436454
455+ /**
456+ * Gets the index of the parameter that is the first format argument.
457+ */
437458 int getParamArgs ( ) {
438459 exists ( FunctionCall fc |
439460 this = fc .getArgument ( _) and
0 commit comments