diff options
author | Matt Strapp <matt@mattstrapp.net> | 2021-09-27 21:18:14 -0500 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2021-09-27 21:18:14 -0500 |
commit | 19b1d6ab35898a88801a3e6bbb4baf863912a4ca (patch) | |
tree | 156c88b99bc8ac7b851ab9dcf6d994e4f5ab97cb /csci5271/hw1/hw1markup.md | |
parent | Merge branch 'master' of git.mattstrapp.net:RossTheRoss/Homework (diff) | |
download | homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.tar homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.tar.gz homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.tar.bz2 homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.tar.lz homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.tar.xz homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.tar.zst homework-19b1d6ab35898a88801a3e6bbb4baf863912a4ca.zip |
commit work done
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r-- | csci5271/hw1/hw1markup.md | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/csci5271/hw1/hw1markup.md b/csci5271/hw1/hw1markup.md deleted file mode 100644 index a870d15..0000000 --- a/csci5271/hw1/hw1markup.md +++ /dev/null @@ -1,43 +0,0 @@ -# Homework 1 -## Q1 - -## Q2 -### A: Perl -After adding a name to the request, add a semicolon followed by the command. The semicolon is the shell command separator which allows it to parse commands. -#### Example Request -``` -"?field-name=;perl+-e+'`command`'" -``` -### B: C - -## Q3 - -## Q4 -### A -#### Mistake 1a: Potentially overloading the array -If the function is called with `to` larger than outer bound of the array, there is a buffer overflow that happens. For example, running it by default with an array of size 10 with a `to` of size 11 on gcc 11.1 causes it to crash because of stack smashing. -##### Mistake 1b: Underloading the array -If the function is called with `from` smaller than 0 will cause some values of the array to be replaced with other values from memory. It did not crash, but it is not the intended behavior. -#### Mistake 2: - -#### Mistake 3: - -### B: Same Signature -```c - void reverse_range(int *a, int from, int to) { - -``` -### C: Different Signature -```c - int* reverse_range(int arr[], int arrSize, int from, int to) { - if (from < 0 || to >= arrSize) - return NULL; - for (int i = from; i < to; i++) { - int temp = arr[i]; - arr[i] = arr[to]; - arr[to] = temp; - to--; - } - return arr; -``` -## Q5
\ No newline at end of file |