First, given you have defined your string as char s1[100];
limit the string input length of scanf by changing your format specifier from:
scanf("%s",s1);
to:
scanf("%99s",s1);// 99, + 1 for NULL terminator
About buffer overflow:
If you define a string, say:
char string[5];//holds 4 characters and a NULL terminator
In memory, it may look like this:
|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
|^ ^ ^ ^ ^| (Allocated space)
strcpy(string, "hold");
results in:
|0|0|0|0|0|0|0|0|0|0|0|h|o|l|d|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
|^ ^ ^ ^ ^| (Allocated space)
No problem, you have written to an area owned by your variable.
When you assign more than it should hold:
strcpy(string, "holds more...");
results in:
|0|0|0|0|0|0|0|0|0|0|0|h|o|l|d|s| |m|o|r|e|.|.|.|0|0|0|0|0|0|0|0|0|0|0
|^ ^ ^ ^ ^| (Allocated space)
If the contiguous areas of memory following the memory assigned to your buffer are empty, and currently unused/unclaimed by any other process at the time you write to them, then the act of writing to them will show no effect, i.e. It appears to "work", and printf(,,) works just fine printing the buffer. But later, you may attempt to write to that same area and find you get an error. This is an example of undefined behavior.
Here is more on avoiding buffer overflow.