Same situation as you. Here is the information I found from a law firm (Z&A ) website. Not sure how good it is (I mean whether it is up-to-date).
Q: I am not in H-1B status and my employer submits the H-1B petition for me before my current status expires. My status has expired but I still have not heard anything from USCIS regarding my petition. May I legally remain in the U.S.?
A: Yes.
Q: May I legally stay in the US if I filed my H-1B petition before my current status expires even though the cap is reached before USCIS decides my case?
A: Yes.