NOTE THAT THIS IS A QUESTION ABOUT SECURITY, NOT A QUESTION ABOUT CODING, please don't answer if you don’t familiar with

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

NOTE THAT THIS IS A QUESTION ABOUT SECURITY, NOT A QUESTION ABOUT CODING, please don't answer if you don’t familiar with

Post by answerhappygod »

NOTE THAT THIS IS A QUESTION ABOUT SECURITY,
NOT A QUESTION ABOUT CODING, please don't answer
if you don’t familiar with it.
Considering the following code (It’s close to Java). Note that
if no value has been associated with k, get(k) returns 0.
double charRatio ( String s , char a ) {
int N = s.length () ;
HashMap counts ;
// suppose at this point counts has been well initialized .
for ( int i = 1 ; i < N; i++) {
char c = s charAt (i ) ;
int v = counts . ge t ( c ) ;
counts . put ( c , v+1);
}
return counts . get ( a )/N;
}
(a)What bugs would you expect a fuzzer(fuzz test) to identify in
this function? Why? (apart from dividing by zero error)
(b) What bugs would be more difficult for a fuzzer to find in
this function?
Why?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply